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

Android AudioFocus onAudioFocusChange not listening for changes

I have been building a MediaPlayer Application, I've been trying to get my Mediaplayer Application to handle AudioFocusChange events. However, It appears no matter how I structure my code I will not listen for AudioFocusChange events and will…
0
votes
1 answer

How to access a derived class member variable by an interface object in java?

I am a new java programmer. I have following hierarchy of classes: public interface base public interface Object1Type extends base public interface Object2Type extends Object1Type public class Object3Type implements Object2Type { byte[]…
Ek1234
  • 407
  • 3
  • 7
  • 17
0
votes
1 answer

I am not reducing visibility from interface yet I get the "Cannot reduce visibility" compile error

I am working on a employee management system for training, and I made some interfaces so I can work from there. As I was working on it, one of my methods gave me a compiler error, saying that I could not reduce visibility. But I never did. Here is…
user8287033
0
votes
2 answers

overridden method does not throw Exception (implements in java)

I have been practicing the use of interfaces in java, but I have a small problem when I want to launch one of my classes. This is the error: ./Jbdc.java:18: error: introducir() in Jbdc cannot implement introducir() in InterfazBD public void…
user11012672
0
votes
1 answer

VB.Net - Implementation on inherited classes

As an example, I have a base class named Animal. Public MustInherit Class Animal Public Property Name As String Public Sub New(animalName As String) Name = animalName End Sub Public Sub Sleep() …
0
votes
0 answers

Trying to throw custom Exceptions

"You should throw an exception that matches the class name." Previously I had made a Date class and a Time class. They each throw InvalidDateException and InvalidTimeException and also work as intended. Currently they are part of a project with…
0
votes
1 answer

Widget class that implements the Comparable interface that compares to method

I'm assuming the existence of a Widget class that implements the Comparable interface and thus has a compareTo method that accepts an Object parameter and returns an int. I want to Write an efficient static method, getWidgetMatch, that has two…
0
votes
5 answers

Java interface implementation?

I'm newbie to Java. I would like to ask different between the following interface examples? public interface MyInterface { public void doSomething(); } like this public class MyClass implements MyInterface { public void doSomething…
edzhome
  • 3
  • 1
0
votes
1 answer

Can a class extend an abstract class and implement an interface at the same time? (java)

If I have for example a class Foo and also an abstract class Bar and an interface Fizz, can the class implement both in its declaration? Or should the interface first be implemented in the abstract class? I ask because of this UML Chart: (! the…
Mel Torment
  • 49
  • 1
  • 7
0
votes
1 answer

Decorator Pattern - undefined constructor

I have a liitle problem with my code. Everything looks good but when I trying to start program I see this: "Exception in thread "main" java.lang.Error: Unresolved compilation problems: The constructor Pakiety(Samochod) is undefined The…
D.Lu
  • 3
  • 1
0
votes
0 answers

Java, linking JFrame to different class

I am new to Java and have set myself the task of creating a calculator that calculated Austudy (welfare) payments based on certain variables. I have the main class working correctly which does all the calculations. I am now attempting to build a GUI…
reCursed
  • 165
  • 1
  • 3
  • 14
0
votes
0 answers

Implement Comparable in generic method Java

In this code my assignment is to implement Comparable. I know I need to put implements Comparable but then I get an error from compiler saying that "Account is not abstract and does not override abstract method compareTo(Account) in Comparable". I…
Viktor V
  • 11
  • 1
0
votes
1 answer

iOS - Swift SDK integration on an Unity App

I may work for a company which wants me to integrate SDK to an app they paid for, The app is made through Unity. I didn't succeed to find any documentation since I'm not an Unity user, For such an app can I implement SDK inside with Xcode, and can…
Reyem
  • 26
  • 6
0
votes
1 answer

Groovy class extends parent implements interface, parent implements method in interface, overide error

Easier to explain with simplified code. I have the following interface interface FooInterface{ public void foo() } I have the following JAVA parent class from a library (notice the final keyword): class Parent { public final foo() } Finally, the…
Jon Burgin
  • 83
  • 1
  • 6
0
votes
0 answers

Java: Why implement an interface and its superinterface?

I understand the term superinterface can be ambiguous. Let me explain. Interface AB extends interfaces A and B. A and B don't extend anything else. Now, we have abstract class X implementing both AB and A. Why is this necessary? Isn't it enough…
kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80