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

How to access to the protected property of class in redefined interface method?

I have a class which implements an interface. interface Animal { public static function giveHug(); } class Dog() implements Animal { protected $race; public function __construct($race) { $this->race = $race; } …
Cutis
  • 949
  • 1
  • 13
  • 32
-1
votes
1 answer

update object in hashmap by java 8 lambda

I created an item named player as follows: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; public class…
-1
votes
2 answers

How can i use multiple implements?

I'm making App with Android Studio. I have a public class MainActivity extends Activity implements View.OnClickListener, OnCheckedChangeListener And I need to add "AppCompatActivity" to the MainActivity. I have searched on the Internet and I found…
문경욱
  • 53
  • 2
  • 9
-1
votes
1 answer

Casting class object to interface C#

I'm wondering what opportunities casting class object to interface that it implements from gives? For example: public interface IOwner { int Owner { get; set; } } public interface IArmy { …
Mak
  • 91
  • 9
-1
votes
2 answers

Implementing interface from different package (callback from other module)

In NodeJS, I can declare a callback in one place and use it in one place to avoid breaking the structure of the project. A.js module.exports = class A(){ constructor(name, callback){ this.name = name; this.callback = callback; …
Kim Ericko
  • 21
  • 1
  • 4
-1
votes
3 answers

Accessing instance variables in implemented class

I am completing an assignment and I was provided an interface called Place. It has several defined methods and no variables. I created a class that implements Place and this contains a string variable name and all the methods from the Place…
-1
votes
1 answer

Keep getting error: ';' expected

I keep getting this error "Error:(28, 43) error: ';' expected". This is the code line where the error is: public void onClick(View view) implements DialogInterface.OnClickListener {
1621656
  • 47
  • 2
  • 5
-1
votes
2 answers

Downcasting object to interface

In short, I'd like to be able to group class instances by a superclass which does not implement a certain interface. But from the set of instances I'd like to call methods from the interface on those instances that implement that interface. Some…
-1
votes
1 answer

How do I make a left arrow of asterisks in Java?

I'am working on a program that makes right and left arrows. They are extended from a ShapeBase class which is implemented from a ShapeInterface. I didn't paste them so it wouldn't look overwhelming. The problem is I have figured out the right arrow…
Mrs.Brightside
  • 115
  • 1
  • 1
  • 12
-1
votes
1 answer

How do I properly implement the Buffer interface for Java?

While studying how to use synchronized buffers, I needed to use the Buffer interface in order to complete the assignment. I'm pretty sure my entire code is correct with the exception of how I implemented the buffer. I got an error code on my public…
Cigaro
  • 51
  • 1
  • 7
-1
votes
3 answers

What is a better coding practice , use implements or methods

i'm using a navigation drawer in android and i've build a listener of two ways. but in all programming codes how would be better code? 1) the first method i implements a class public class MainActivity extends AppCompatActivity implements…
Mike Brian Olivera
  • 1,414
  • 1
  • 16
  • 21
-1
votes
1 answer

Implements an interface after object creation

I was wondering if it was possible for me to implement an interface after the object has been created? I have'nt found anything on it except for this link but it's not really what i'm looking for plus it's for android programming Is there any way to…
Chax
  • 1,041
  • 2
  • 14
  • 36
-1
votes
1 answer

Can I implement a record as a class in programming languages that uses it?

My instructor for "Programing Languages Design & implementation" course asked us to do a homework, and this homework asks that: "can you implement a record as a class ?"
FortMax
  • 33
  • 11
-1
votes
4 answers

No suitable Constructor Found

This is my code and i am trying to pass the parameter from main to cat class but its saying no constructor cant figure out what to do a little help would be appreciated. public class Cat extends Animal implements Pet { public String name; …
codeBeginner
  • 3
  • 1
  • 2
-1
votes
1 answer

Java already implementing a class

apologies if this is an easy question, I have a java class that implements Serializable public class product extends UnicastRemoteObject implements Serializable I wish however to use threading within the same class, can anyone point me in the…
TotalNewbie
  • 1,004
  • 5
  • 13
  • 25