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

Implementing Java Interface with extra method in implementing Class

First post so be gentle. :) I'm not sure what I am doing wrong here, hopefully someone can help me out. I have an Class that implements the List interface. This class also has it's own method that will only add an item to the list if it is not…
RalphW
  • 43
  • 3
4
votes
8 answers

How are Java interfaces used?

I'm a beginner Java programmer and have been experiencing difficulty grasping what the big picture of implementation is in OOP in the Java language. I will try to frame my question with the pseudocode below (apologies if it is not that…
4
votes
2 answers

Implementing Inherited Interface with Overloaded Member vb.net

I am trying to implement a derived interface in a class. My interfaces and class are similar to the following. The Namespaces relate to different projects that hold these interfaces and the class: Namespace ns1 Public Interface IParent …
llc381
  • 101
  • 2
  • 10
4
votes
4 answers

why can a class implement multiple interfaces?

This is the only question about interfaces in oop I can't seem to fully explain. So again, why in oop can a class implement multiple interfaces? If you can provide a few examples that would be great. thanks in advance.
user1664427
  • 237
  • 4
  • 12
4
votes
3 answers

Overriding methods in PHP?

In other OO languages like Java we can override a function, possible using keywords/annotations like implements, @override etc. Is there a way to do so in PHP? I mean, for example: class myClass { public static function reImplmentThis() { //this…
Jinu Joseph Daniel
  • 5,864
  • 15
  • 60
  • 90
4
votes
6 answers

Is an interface part of the Object hierarchy?

Please find the code snippet below which explains the question. public class Test { /** * @param args */ public static void main(String[] args) { I ref = new B(); ref.equals(""); } } interface I{ } class A { public void…
ambar
  • 2,053
  • 6
  • 27
  • 32
3
votes
2 answers

implementing Comparable interface from abstract class with concrete subclasses

package geometricobject; public abstract class GeometricObject implements Comparable { private String color = "white"; private boolean filled; private java.util.Date dateCreated; protected GeometricObject(){ dateCreated = new…
MISMajorDeveloperAnyways
  • 1,359
  • 3
  • 14
  • 20
3
votes
5 answers

Java extends alternatives

I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of extends, that is, it's impossible for a certain class to extend two classes. Here's the model: …
vedran
  • 2,167
  • 9
  • 29
  • 47
3
votes
2 answers

Compare static addressing and import for extends/implements

Is there any difference between using public ClassName extends some.package.Class implements another.package.Interface {} and import some.package.Class; import another.package.Interface; public ClassName extends Class implements Interface {} when…
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
3
votes
1 answer

Java implements webbrowser: does this save to browser cache, and can you serve content directly?

Still trying to decide which application will suit : current options JxBrowser vs SWT widget. Java application implements a webbrowser control like JxBrowser or SWT browser control. Both of these provide options to pass info from java to…
John
  • 346
  • 1
  • 9
  • 19
3
votes
3 answers

__autoload detecting and including interfaces

I am using __autoload in my script to include classes as needed. My script uses cues in the class name to find the file containing it. If it ends in model it is in the model directory, controllers are in the controller directory, etc. I am…
Tyson of the Northwest
  • 2,086
  • 2
  • 21
  • 34
3
votes
0 answers

Implement a marker trait for tuple `(L, R)` if either `L` or `R` implements it

I have a marker trait PoisonPill which is implemented by certain structs. I would like to implement it for a tuple (L, R) if EITHER L or R implements PoisonPill (not necessarily both). Is it possible to do that in Rust 2018, and how? Preferably…
quant_dev
  • 6,181
  • 1
  • 34
  • 57
3
votes
2 answers

Parent and child classes implementing a common interface, repeatedly

Today i found in my codes what appears to be a child class implementing an interface that the parent class is already inheriting. May i know if this has any adverse side effects or intentions, as i am working on to remove it from the child class as…
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
3
votes
1 answer

When implementing an Interface in VBA, do the implemented functions need to be private or public?

I am reading up on creating class factories here: https://rubberduckvba.wordpress.com/2018/04/24/factories-parameterized-object-initialization/ and I am confused why they are making the implemented functions private, wouldn't we want them to be…
Name
  • 209
  • 1
  • 4
3
votes
1 answer

Typescript incorrect type inference when class implements interface

When using composition approach in typescript over inheritance one, I want to describe my entities according to what they "can" and not what they "are". In order to do this I need to create some complex interfaces and then for my classes (I use…
Charlie Scene
  • 85
  • 1
  • 8