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
0
votes
2 answers

java interface method return value is itself

I am a beginner at java. I want to create new append string method where MyBuffer buf = new MyBuffer(1); buf.append("This"); would add the String "This" into buf but MyBuffer buf = new MyBuffer(1); buf.append("This"); buf.append("That"); would…
csts
  • 71
  • 3
0
votes
5 answers

if class B implements interface C, and class A extends B, does class A need to implement C too?

I was reviewing some code and stumbled upon this: export class A extends B implements C { ... } And then this other class export abstract class B implements C { ... } Then I thought, if class A extends B, and B already implements interface C…
0
votes
3 answers

Method argument not taking generic that implements an interface

I'm having a weird issue here it seems. I have an interface, known as Sortable. I then have another class, like so: public class LeftSort { private List list; public LeftSort(List list) { this.list…
user5549921
0
votes
2 answers

What to do with required, but empty, implementations?

I have a google map class class MapActivity : FragmentActivity(), OnMapReadyCallback, LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { However i only use a few of the required functions…
Joel Broström
  • 3,530
  • 1
  • 34
  • 61
0
votes
1 answer

Need to set a variable in a class which is extended from another class. Or override the type

Why do I keep failing this test? Test Cube(1.0, 1.0, 1.0) sets the type to "Cube", width, length and height each to 1.0 Test feedback Expected: Cube, 1.0, 1.0, 1.0 Yours: Rectangle, 1.0, 1.0, 1.0 I need the cube class to be able to set its type to…
Blank Reaver
  • 225
  • 3
  • 5
  • 17
0
votes
1 answer

How implement and use switch when have Animation

this is my activity: public class MainActivity extends Activity implements Animation.AnimationListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
POUYA KARIMI
  • 327
  • 1
  • 3
  • 6
0
votes
1 answer

C# List implementation... in Java

I'm learning Java and I'm trying to do something I've always done in C#... in Java. The goal is to wrap the class "MyItem" into a List of "MyItems". This makes it easier to reason about (MyItems is much easier to read/understand than List...…
WernerCD
  • 2,137
  • 6
  • 31
  • 51
0
votes
2 answers

Class implements Interface

So I started learning Interfaces and now I'm wondering when to use Interface i = new Class(); and when to use Class c = new Class(); and I noticed that I can't use class methods if I do it the first way, only interface methods. Do you know…
user8118329
0
votes
3 answers

C# implementing interfaces with generic type overrides

To simplify my question, I'm using IList and IList as the example. Since IList declared a method Add(object value) and IList declared a method Add(T value). My new class has to have two methods for implementation. class myList : IList,…
Karl Jr.
  • 15
  • 4
0
votes
3 answers

pass interface to a class which implements this interface

Hi I am reading some code in a project which I just start to work on and see some code like this, which I could not understand. public class A implements Ignite { protected Ignite ignite; ....... protected void checkIgnite() { …
TryMyBest
  • 333
  • 5
  • 11
0
votes
2 answers

Private methods in TypeScript class implementing interface

I have a CPU-constrained project with a large number of classes and I use interfaces to minimize the number of imports I use in each module. However, I've run into some issues when declaring private methods on classes that implement their respective…
Ben Bartlett
  • 322
  • 4
  • 14
0
votes
2 answers

"Class is not abstract and does not override method in class" error, but I implemented those methods

I know there are lots of questions related to this compiler error in Java. I have to code the behavior of a simple media player that plays images, audio files and videos. I wrote seven classes, three of them being interfaces. Here's a…
alemootasa
  • 83
  • 2
  • 9
0
votes
0 answers

How to implement callbacks properly

I have two objects that needs callback implementation, what if both objects need different implementation? if i implement it at class level by implement keyword, interface methods only appear once in that activity, also If I'm calling both callback…
blackHawk
  • 6,047
  • 13
  • 57
  • 100
0
votes
0 answers

System.MissingMemberException on named range vb.net

I am receiving a System.MissingMemberException: 'Public member 'Controls' on type 'Worksheet' not found.' error on the WS.Control line of the code below. The code below is the only solution I have been able to come up with to access the active…
Grackel
  • 21
  • 6
0
votes
0 answers

mouseListener - Implements vs addMouseListener

I have a JTable and I want to detect a single click and double click on a row. I recognize I need to create a mouseListener. However I have seen examples that extend a JTable and implement a mouseListener as part of the JTable definition, as well as…
Wt Riker
  • 514
  • 12
  • 24