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
-2
votes
1 answer

Create List of classes that extends and implement

I have a several classes that define as follow : class A extends Super implements Interface {} class B extends Super implements Interface {} I want to create list of these classes. I try the following: public class C { List> classes…
-2
votes
1 answer

Meaning of implements when defining a new class

I saw this code class BinTree1 implements BinTree{ Object val; BinTree1 left, right; // abstr(null) = E // abstr (val, left, right) = // N((abstr left) val (abstr right)) public BinTree1 (BinTree1 l, Object o, BinTree1 r){ …
xamiax
  • 291
  • 1
  • 2
  • 8
-3
votes
1 answer

How to have a java class extend multiple attributes?

So let's say you have a Creature class. Now say you have a Hostile class that extends it, and a Passive class that extends it, for hostile and passive creatures respectively. If some creatures can fly and some can't it would make sense also for…
-3
votes
1 answer

Is it possible to extend more then one abstract class?

Is it possible to extend more then one abstract class? I'm trying to convert the java bytecode library in C# I figured out in the original java bytecode library it extended 2 interfaces or in my case abstract class (because it has…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
-3
votes
2 answers

Populating Interface

Can anyone tell me how do I populate my fields in my interface IAccount? I'm having an error in x.Add(new IAccount ... public class IPersonRepo : IAccount { string connectionstring =…
RE0824C
  • 73
  • 1
  • 3
  • 12
-3
votes
1 answer

C# to VB.NET conversion Implements failure

I am trying to convert a piece of code from C# to VB.NET public class ResourceInterceptor : IResourceInterceptor { public bool NoImages { get; set; } private static string[] _imagesFileTypes = { ".png", ".jpg", ".jpeg", ".gif", ".bmp",…
tmighty
  • 10,734
  • 21
  • 104
  • 218
-3
votes
1 answer

Arraylist can't add element

Why isn't this working for me? public class Band { public void addMember(Musician musician) { musicians.add(musician); System.out.println("Muscian: " + musician + "was successfully added"); } } public static void…
vanark
  • 1
  • 4
-3
votes
3 answers

How to tell how many methods an interface has

How many methods is an ideal amount for an interface to have? And how can you tell how many methods an interface have from an implementation? Would the Mouselistener interface have 5 methods then?: // ToggleButton Listener Class: class…
Sophia Ali
  • 301
  • 2
  • 6
  • 14
-4
votes
1 answer

Java Generic on Class

How to run a anonymous method from class . For instance, I have a class Class A { void Save(){ //do something } } Class B { void Save(){ //do something } } When I getting the object from somewhere: Object…
Md. Alim Ul Karim
  • 2,401
  • 2
  • 27
  • 36
-4
votes
3 answers

How ArrayList work with unsupportedOperationException?

I am assigned to implement my own Arraylist and Linkedlist that works very similarly to Java's provided ArrayList and LinkedList in Java.util.*, but not all of methods but some of them. Assignment description says following: So it sounds like that…
online.0227
  • 640
  • 4
  • 15
  • 29
-4
votes
7 answers

Java List is an interface with implemented methods?

Java Lists (also Collection) have method implementations (add(),get()) so how can they be INTERFACES? I would expect: List nums = ArrayList (); nums.add(5); that the above code would be in error since add() should be…
Brett Penza
  • 39
  • 1
  • 4
-4
votes
3 answers

How would I go about implementing this Java interface?

I am currently in the design mode for this problem: Implement the Speaker interface that is predefined. Create three classes that implement Speaker in various ways. Create a driver class whose main method instantiates some of these objects and tests…
-5
votes
1 answer

robot scenario - java inheritance, interface types and abstract classes

I would like to create a programme based on a robot scenario, that includes abstract classes, interface types and array lists. Can anyone give me some advice on how to create this scenario (via a UML diagram to show how everything links). This…
1 2 3
26
27