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

Does Not Take Parameters in Java

I'm receiving the error "type Stack does not take parameters public class ArrayStack implements Stack" from this code: public class ArrayStack implements Stack { private E[] data; private int size; public ArrayStack() { data = (E[])(new…
Alec
  • 37
  • 1
  • 6
-1
votes
3 answers

Java - How to properly use Extends/Implements

Okay so I am kind of confused about the uses of "extends" and "implements". Let me give a scenario, let's say I am making a simple tower defense game. So it was my understanding that if I made a class (TowerBase.java), I can fill it with variables…
willbattel
  • 1,040
  • 1
  • 10
  • 37
-1
votes
1 answer

How to implements Iterable

In my program, I write my own LinkedList class. And an instance, llist. To use it in foreach loop as following, LinkedList needs to implement Iterable? for(Node node : llist) { System.out.print(node.getData() + " "); } Here following is my…
Zoe
  • 997
  • 4
  • 10
  • 19
-1
votes
3 answers

Implementing a java interface

I have an interface that I want to implement that looks like this, but with more methods. There is just one here for example: public interface List{ public void add(int position, Album album); } Then my class that implements it starts like this,…
Ubunfu
  • 1,083
  • 2
  • 10
  • 21
-2
votes
1 answer

PHP Strict Standards throwing error on subclass that does not override superclass method

I am encountering the following warning: Strict Standards: Declaration of FGLU_Activity::delete() should be compatible with FGLU_Entity::delete($id, $commit = true) in ... FGLU_Activity extends FGLU_Entity and does NOT override the static ::delete…
GraceRg
  • 23
  • 4
-2
votes
1 answer

Multiple inheritance in java through interfaces

i want to inherit singly, circular & doubly linked lists in a parent class "list". Each class has its own interface.i first inherited singly, doubly & circular interface in a "list" interface then implemented that interface in my parent class…
-2
votes
1 answer

error while implementing mouse listener java

I am currently not new to java but the first time I got this error here is a sample of my code ! Explains why even if I implements the mouseListener methods I cant seem to make my code work im working with IntelliJ package com.company; import…
Jay
  • 1
  • 1
-2
votes
2 answers

Android/Java: x in MainActivity cannot implement Y in Interface

I'm new to Java and I can't seem to wrap my head around this one. I am trying to fetch the contents of a web page (txt file) from a URL and add each line to an ArrayList. I can spit the array out using Log.d in onPostExecute, but I would like to be…
mmotti
  • 341
  • 1
  • 3
  • 12
-2
votes
2 answers

Specify that a Class argument must implement a particular interface

I am writing a method which is passed a Class as an argument, like this: public void doStuff(Class clazz) { /* do stuff */ } I can then call the method like this: doStuff(FooBar.class); How do I enforce at the compiler level that the…
user149408
  • 5,385
  • 4
  • 33
  • 69
-2
votes
2 answers

ActionPerformed & ActionListener & implementing

Getting error on line where HandlerClass implements ActionListener saying "Multiple markers at this line - Syntax error on tokens, delete these tokens - Syntax error, insert '}' to complete Block" What I've got wrong there ? import…
Mark Alexa
  • 125
  • 2
  • 9
-2
votes
1 answer

I'm not entirely getting the point of interfaces in java

I have been learning about interfaces, and I'm not entirely sure when to use it. So I'm going to make up a scenario and tell me it it is a good way of using it. Say I'm making a game, that have different characters (I was going to say classes but…
mooL
  • 59
  • 1
  • 3
  • 7
-2
votes
1 answer

Is there any limit to the implements and extends in the activities?

I am getting error from the following sentence public class FirstFragment extends Fragment, AppCompatActivity implements AbsListView.OnScrollListener { I am not aware of any limit, what could be wrong?
MDR
  • 55
  • 7
-2
votes
1 answer

How to import simple ongesture listener and override its methods properly?

I have this error: It says "i dont know where to find onFling, onScroll etc from superclass of simple on gesture listener, even though i override it my code: package nis.tryout_erjan; import…
ERJAN
  • 23,696
  • 23
  • 72
  • 146
-2
votes
1 answer

JComboBox items from ResultSet Issues

I am stuck here and see only one solution which I am trying to refrain from because, it will make my code look messy. I have a JComboBox.addPopupMenuListener in one class. I have another class which implements addPopupMenuListener. In the other…
Bharat Nanwani
  • 653
  • 4
  • 11
  • 27
-2
votes
3 answers

I've defined the constructor haven't I? Why won't it compile?! Java

I'm writing a program for a calculator and I have added this into my main Java file` CalculatorEngine calcEngine = new CalculatorEngine(); This lnks to my Class file as so: public class CalculatorEngine implements ActionListener {//code here…
Bartholomew
  • 9
  • 1
  • 1
  • 5
1 2 3
26
27