Questions tagged [implements]

`implements` is a keyword in several programming languages used to denote implementation of an interface.

implements is a keyword in several programming languages which support OOP (such as Java or PHP) used to denote interface implementation (as opposed to extends used to denote implementation inheritance).

Related

404 questions
1
vote
2 answers

How to pass an interface to a method

I am trying to create a function which takes two parameters - a class instance and a interface - then returns true if the provided class instance implements the provided interface. My problem is that I cannot find a way to pass a interface as a…
HomeworkHopper
  • 300
  • 1
  • 12
1
vote
1 answer

error: class, interface, or enum expected (implement java)

I have been practicing the use of interfaces in java, but I have a small problem when I want to launch one of my classes. This is the error: ./Jbdc.java:18: error: introducir() in Jbdc cannot implement introducir() in InterfazBD public void…
user11012672
1
vote
0 answers

Angular typescript implement same generic interface twice on class

Hi I have bee kicking around code for awhile I do have a work around but I feel that it is not correct. Any help is much appreciated. I am using the pattern shown here enter link description here I am trying to implement the same generic interface…
Natdrip
  • 1,144
  • 1
  • 11
  • 25
1
vote
1 answer

How does an interface stub method with no body, can have an effect?

Hello so I am learning Java and I have a question puzzling me, some interfaces when we implement them and override their empty methods even if we put nothing in the override when we call the method it has an effect. Some specific examples for that…
Zeyad
  • 537
  • 2
  • 7
  • 15
1
vote
4 answers

How or why do listener interfaces work? And do interfaces have any other use rather than being a listener?

Whenever we want to create a listener, we implement a listener interface. For example, lets implement SensorEventListener. Now we have to override the methods of this listener interface. public void onSensorChanged(SensorEvent event); and public…
Huzo
  • 1,652
  • 1
  • 21
  • 52
1
vote
0 answers

KeyListener error - class does not override

I'm having trouble using KeyListener. I keep getting an error that says the Controller is not abstract and does not override abstract method keyReleased(java.awt.event.KeyEvent) in java.awt.event.KeyListener but I already implemented keyReleased. …
Chae
  • 163
  • 1
  • 3
  • 12
1
vote
1 answer

Use of Same method in Interface and Abstract class

I know this type question has been answered multiple times and it might get tagged as duplicate I have a structure like this public interface service{ public void sayHello(); } public abstract class AbstractService{ public void…
bajji
  • 1,271
  • 3
  • 15
  • 37
1
vote
5 answers

How to implement list view inside fragment android studio Kotlin

How to implement list view inside fragment android studio Kotlin I am new to programming and I want to make my app a simple listview of names of places by region. This is the fragment name VisayasMindanao package com.gumangan.uecficenterslist import…
user10205980
1
vote
0 answers

Different ways of Implementing Interface in C# vs Java

In java I can implement in following two ways : package com.company; class ToInherit { public interface MyInterface { void methodInInterface(boolean isError, String text); } } Main.java package com.company; public class Main { public static…
Pishang Ujeniya
  • 176
  • 5
  • 13
1
vote
2 answers

Angular 2: Cannot find ngOnInit/ngOnDestroy

NOTE: I found the article cannot find OnInit in typescript during implementation but the code below is already importing OnInit/OnDestroy. All the examples I've found (e.g., Using Route Parameters) indicate adding the implements OnInit/OnDestroy…
AdvApp
  • 1,094
  • 1
  • 14
  • 27
1
vote
0 answers

Google Maps broken map change listeners will not inherit or implement

I can't figure out what is going on with this. Nothing I do seems to work. Basically I get three errors, all from the same strange occurence. My activity will not implement the map change listeners from google maps. For the first part of the…
chrisdottel
  • 1,053
  • 1
  • 12
  • 21
1
vote
0 answers

Google maps is blank with just the logo at the bottom

I am new to android development and this is my first app. I have been trying to implement google maps with the bottom navigation view however the google maps shows up blank with only the logo at the bottom. I have tried all solutions I found however…
yolo
  • 31
  • 3
1
vote
2 answers

Constrain method signatures through interface using generics in TypeScript

I have two interfaces that extend a third one, for example interface Animal { /* name, etc */ }; interface Dog extends Animal { /* dog specific things */ } interface Cat extends Animal { /* cat specific things */ } I want to create for the two…
Vince Varga
  • 6,101
  • 6
  • 43
  • 60
1
vote
1 answer

Is it possible to determine if two objects both implement a common interface which is not specified at compile time?

Given Object1 and Object2, are there any techniques for determining if they both implement a common interface? No problem if the interface is known at compile time (use typeof ... is [known interface]), but what about if interface isn't specified…
PAHTDC
  • 40
  • 9
1
vote
2 answers

Implement a string

I would like to make a class which looks like a String to VBA. That is, if I make a function with a string argument, and pass this object instead, I won't get any errors. I thought Implements String would work, but apparently it's not even an…
Greedo
  • 4,967
  • 2
  • 30
  • 78