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

Delphi interface implements

I would expect that the reference counting should work on the outer aggregating object in an interface implementation. If I can refer to another example: Clarity in classes implementing multiple interfaces (alternative to delegation): Here is a…
Gryffe
  • 413
  • 1
  • 3
  • 9
15
votes
3 answers

implements vs extends in generics in Java

Can someone tell me what the differences between the first and second codes are? MaxPQ stands for priority queue, which is a collection of "Key" objects that can be compared with each other. Code 1: public class MaxPQ
Popcorn
  • 5,188
  • 12
  • 54
  • 87
14
votes
2 answers

Bug when using interfaces on larger projects

For larger VBA projects (40,000+ lines of code) I cannot properly use interfaces because the Application (I mainly use Excel) will crash quite often. Apparently, this is because the code cannot remain compiled (from my understanding VBA code gets…
Cristian Buse
  • 4,020
  • 1
  • 13
  • 34
13
votes
6 answers

java.lang.Number doesn't implement "+" or any other operators?

I'm creating a class which is supposed to be able to be used with an array of any type of number (float, int, etc), so here is one method I have: // T extends Number public synchronized T[] average() { Number[] ret = new…
Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
11
votes
4 answers

Extending an inner interface?

I got a simple question: Why does Eclipse scream about implementing these two interfaces? public abstract class Gateway implements IPlayerity, IItemity { public interface IPlayerity { ... } public interface IItemity { ... } //…
imacake
  • 1,703
  • 7
  • 18
  • 26
11
votes
3 answers

VS Code auto generate interface methods in php class?

How can i "auto implement"/generate methods from interfaces into PHP classes? I wanna use VS Code for it interface : interface MyInterface{ public function myMethod($param); } class : Class MyClass implements MyInterface{ //myMethod should be…
Amibel
  • 149
  • 1
  • 1
  • 7
11
votes
4 answers

Implements Comparable to get alphabetical sort with Strings

I would like an object to be comparable (to use it in a TreeSet in that case). My object got a name field and I would like it to be sorted by alphabetical order. I thought first that I could use the unicode value of the string and simply do a…
Silver Duck
  • 581
  • 1
  • 5
  • 18
11
votes
7 answers

What do you call a class that implements an interface?

Say class A implements interface B; what can we call class A in relation to interface B? Is it the case that class A is a 'subclass' of interface B (as if B was a class), or is there a special term for implementing an interface, or is there none? …
user1585968
  • 121
  • 1
  • 5
10
votes
5 answers

How to implements a method of a generic interface?

I have this interface: public interface ParsableDTO { public T parse(ResultSet rs) throws SQLException; } Implemented in some kind of dto classes and this method in another class: public > List
user4789408
  • 1,196
  • 3
  • 14
  • 31
10
votes
2 answers

Kotlin: How can I let Android Studio implement interface's function at bottom of class

When implementing an interface in a Kotlin class: When I press Alt+Enter on ClassName I can have the IDE add an interface's functions via 'implement members'. It's kind of annoying that in Kotlin these functions are added at the top of the class. I…
Rik van Velzen
  • 1,977
  • 1
  • 19
  • 37
9
votes
3 answers

Why the need to redefine properties when implementing an interface in TypeScript?

I'm getting into classes and interfaces. And I got one thing about it that annoys me, this is the first time I work with these kind of things so bear with me here.. Let's say I got this interface: // IFoo.d.ts export default interface IFoo { foo:…
Thimma
  • 1,343
  • 7
  • 33
7
votes
5 answers

Java overriding two interfaces, clash of method names

I am implementing the Map and the Collection interface in one class, but the remove(Object) method occurs in both interfaces, therfore eclipse shows me some errors. The return types are different, one returns boolean and the other V but that…
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
7
votes
2 answers

Extending a class that implements Serializable

If I extend a class that implements Serializable, do I need that class to also implement Serializable? For instance if I have, public class classToBeExtended implements Serializable Then will this suffice? public class classThatWillExtend extends…
Mars
  • 4,677
  • 8
  • 43
  • 65
7
votes
3 answers

How to Correctly return something that extends from a class and implements an interface?

Background This question is for both Java and Android developers. On Android, I want to have a function that returns something that extends from View and implements Checkable, both are part of the Android API. What I've tried After searching a bit…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
7
votes
1 answer

SQLiteDatabase 'does not implement interface'

Getting this error when I use SQLiteDatabase as a Closeable I've got a sample project to recreate it: https://github.com/blundell/SQLDatabaseError With a class that extends SQLiteOpenHelper: public class DatabaseHelper extends SQLiteOpenHelper…
Blundell
  • 75,855
  • 30
  • 208
  • 233
1
2
3
26 27