Questions tagged [interface-implementation]

137 questions
0
votes
0 answers

How do I get VS to implement a default method in ALL classes based on interface

I have and interface with 5 mthods. I want to add a 6th method, but I would like to avoid having to manually add the method to each claas I have that uses the interface. Can I either: Tell interface the class does NOT have to be…
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
0
votes
0 answers

Why is an Interface subtly changed when selecting "Implement Interface"?

I understand that there is probably no empirical difference between "string" and "String" but it still seems odd to me that this interface: List GetPlatypus(String duckbillName, String pwd, String pondNum); ...when implemented in a class…
0
votes
2 answers

Object as a parameter?

I had asked a question about implementing a class by subclass in Java previously and I found a different approach used.(different for me!) URL: here public void paintComponent(Graphics g){ this line was confusing for me, for a class was passed as a…
user3519322
  • 69
  • 1
  • 1
  • 7
0
votes
1 answer

DataObjectSerializer interface implementation CS0535

I am trying to make a class of my project serializable so I can exchange objects of it throgh a network for a client/server-application. Since I also want to include "child"-objects and private members I chose to do so with the help of…
Mark
  • 419
  • 1
  • 6
  • 21
0
votes
1 answer

Precise definition of opaque types and where precisely are their definitions hidden from the user and how to peek at them?

I'm using Visual Studio. I have come across code like the following: typedef struct A_def A; typedef struct A *A_ptr; A_def is hidden. It's an opaque type. It's implementation is hidden so when I go to its definition, nothing happens in VS. Is this…
Nothing
  • 99
  • 12
-1
votes
3 answers

Alternatives to interface reimplementation

I'm reading the excerpt below from Joe Albahari's excellent "C# 9 in a Nutshell" and am trying to understand what's being described here in bold. Is anyone able to explain the alternative approach in a way that I can understand better? This seems…
-1
votes
1 answer

What's the proper way to share the interface?

What if I have a project that relies on the abstraction(interface) but does not contain any implementation for this interface. Therefore I want to give that interface to someone who can implement it so I (or someone else who is going to use my…
THE Waterfall
  • 645
  • 6
  • 17
-1
votes
2 answers

Why its possible to override explicit implementation?

We usually implement interfaces explicitly when it’s not right to access interface member directly from implementer class. Weather it has to be internal or it causes conflicts with API design or when it increases the chance of misusing methods.…
M.kazem Akhgary
  • 18,645
  • 8
  • 57
  • 118
-1
votes
1 answer

What is the seperate implementation interfact class idiom and when do I use it?

I have occasionally come across what I can only describe as the "interface-implementation idiom", where a class is separated into an "interface class" and an "implementation class". What is the philosophy or reasoning behind this? What is an example…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
-1
votes
5 answers

How can I make a class both implement an Interface and inherit from another class

I want my class to implement an interface and also get the additional properties from Auditable table. Can I do both? I have tried to do it here but I am getting an error in my IDE. public partial class ObjectiveDetail : IEquatable,…
Alan2
  • 23,493
  • 79
  • 256
  • 450
-2
votes
2 answers

Java Interface and its Implementation

I am doing an exercise, which needs the DogSchool to implement the PetSchool. I intend to make a array list of the animals that registered in the pet school, and the dog school need to distinguish dogs from other animals. The characterisation of…
Anthony
  • 51
  • 7
-2
votes
2 answers

Delphi - Interfaces inside interfaces

I'm an newbee concerning interfaces. I googled a lot but i can't figure out what to do in the following situation. i created serveral interfaces, which use each other: IPart = interface(IInterface) Function getName: string; procedure…
Hanne
  • 39
  • 3
-3
votes
2 answers

Calling specific implementation classes of an Interface in Java

I am trying to build a simple API, where I have an interface AnimalService and its implementation classes are LionImpl, TigerImpl, ElephantImpl. AnimalService has a method getHome(). And I have a properties file which contains the type of animal I'm…
ktgirish
  • 257
  • 1
  • 2
  • 12
-3
votes
3 answers

Why does this implementer method not see its sibling?

I've got a class that implements an interface: public class SQLiteHHSDBUtils : IHHSDBUtils { void IHHSDBUtils.SetupDB() { . . . if (!TableExists("AppSettings")) . . . bool IHHSDBUtils.TableExists(string…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
-4
votes
2 answers

Creating UML for the Java code

I have to create UML diagram for the two Java program/code written below. My queries are: Is a sub class of an interface also an interface? Is a class implementing Runnable Interface also an interface? Can't methods/functions be called Operations…
1 2 3
9
10