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

Method matches interface prototype, but won't override

I have the following code: public interface StackInterface { public T pop(); public void push(T n); } public class myStack implements StackInterface> { Node head; Node next; Node tail; public myStack(T t) { …
Dax Duisado
  • 197
  • 2
  • 11
0
votes
1 answer

Java Error - arrayqueue.ArrayQueue is not abstract and does not override abstract method dequeue()

I'm having trouble with a java error specifically, this one: arrayqueue.ArrayQueue is not abstract and does not override abstract method dequeue() in arrayqueue.Queue at arrayqueue.ArrayQueue.(ArrayQueue.java:11) Here's the code the error is…
Solsma Dev
  • 481
  • 6
  • 22
0
votes
0 answers

Package statement mesing up application

Okay, so i'm fairly new to package statements and have came across an error that i've spent a pretty long time on. package commonADTs.Stacks.StackADT; import commonADTs.Exceptions.*; public class ArrayStack implements StackADT { I'm getting…
Feek
  • 297
  • 3
  • 15
0
votes
6 answers

Interface Method Usage(Java)?

Can Someone Explain how the methods of interface used in classes? Note: My Doubt is "Methods are already defined in Class then why we should implement it ? " For Example : interface printable{ void print(); } class A implements printable{ public…
NarutoUzumaki
  • 91
  • 1
  • 1
  • 11
0
votes
1 answer

How can i assign value to a class when using an interface?

I have a Java class which implements an interface, this class have a constructor that takes a String value and all the methods is that class are rely on that value in order to get work, so, what can i do if i want to deal with the interface directly…
Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
0
votes
1 answer

Shapes, Drawable"Shapename", Shape Inheritance and Interface

This is my last exercise in my headfirst book but when i run the application the shape is not being drawn, I'm pretty stumped cause there are no errors. public class ShapesDriver extends Frame{ //You said Frame in the Tutorial4 Document private…
Melky
  • 167
  • 3
  • 13
0
votes
2 answers

Implement OnClickListener to make Show Context Menu With Short Click not Long Click

I have code like this : public class ListConActivity extends Activity { private String[] Distro = { "Ubuntu", "Arch Linux", "Mandriva", "Open Suse", "IGOS Nusantara", "Linux Mint", "Debian", "Fedora", "CrunchBang",…
Arief Rivai
  • 228
  • 6
  • 19
0
votes
1 answer

Java Thread does not terminate

I am trying to animate a triangle when two triangles have been clicked twice. As soon as I click them twice triangle 0 starts moving until moveX reaches 20, while(moveX < 20), but then it doesn't seem to reach a terminated state, it doesn't go…
user1420482
  • 147
  • 3
  • 12
0
votes
2 answers

Declaring an object that implements an interface

I'm trying to declare an object which must implement a specific interface. I thought the following would work in Java as it does in some other languages but I'm at a loss here: Class implementingObject Any pointers…
PowerAktar
  • 2,341
  • 1
  • 21
  • 17
0
votes
4 answers

Java Impementing an interface. With additional functions

Hello ive added two new functions to the implementation of an interface. this is the implementation file... import au.edu.uow.Collection.Album; import java.util.ArrayList; public class CDAlbum implements Album { private String Title; …
Daniel Del Core
  • 3,071
  • 13
  • 38
  • 52
0
votes
1 answer

Extending an Activity adding a callback method

I'm having a go at extending Activity to define a standard method I can callback to from an AsynchTask. Here's a skeleton code. public class R3Activity extends Activity{ public void displayresult(String xmlresult){ …
user1325094
  • 339
  • 5
  • 13
0
votes
1 answer

Nested classes and implementing interfaces in java

Although this code is from an algorithm text, I have a bit of a trouble regarding nested classes and interfaces - actually, 90% of my confusion arises from how this code implements the interface. Again, this question is not about the algorithm…
user1164937
  • 1,979
  • 2
  • 21
  • 29
0
votes
3 answers

Multiple Inheritance with Base Class and Interface having same function with different return types

I have written a class which is a base class of Class A and implements an interface of Class B. Now my compiler is giving a wierd kind of error saying that "The return types of functiona from Class A is not compatible with return type of functiona…
kashipai
  • 149
  • 3
  • 13
0
votes
1 answer

Why won't my interface typed objects preform methods that are not declared in the interface?

Here is the code I'm having problems with: The interface: public interface anInterface { void printSomething(); } Class that implements the interface: public class aClass implements anInterface { public aClass() { } public void…
Djole Pi
  • 107
  • 2
  • 14
-1
votes
2 answers

Why does my methods just skip?

I have two questions - I'm a beginner in Java but have a huge java project :( If I implement a class (which is an interface that has two void methods) and I try to write another method in my class, it compiles but at run time the method is…
Rabiani
  • 143
  • 2
  • 5
  • 12