answersLogoWhite

0

No. An interface can only be implemented.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Can you instantiate an interface?

According to a beginner's book on Java, an interface can't have constructors. Also, the interface itself can't contain the method implementation.


How do you instantiate in vbnet?

dim obj as object obj = new object();


This key word causes an object to be created in memory?

To instantiate a object, we use the new keyword in Java, which creates an object in memory.


What is the purpose of constructor in object oriented programming?

A constructor in a class is one of the first pieces of code to be executed when you instantiate a class. The purpose of constructors is to have code that initialize the class and prepare the variables that may be required by the class...


Why instance in abstract or interface?

we can make object of interface but in abstract we can not make object of it interface ab= new Classs(): in interface we maintain multiple inhetence by use of obj of interface we if inherit two class have same fun then we give the name of that interface and call the pertucular that fun interface ab= new class() ab.add(); but in Astract Class we cannot make object of it only class class wich inherit it can make object class ab2= new Class(); and by obj we call function of drived class ob2.add();


Can you create an object of interface in java?

maybe


What happens when you write Static word to a class or Methods?

there would just be one instance of the object no matter how many times you instantiate it.


Do abstract classes and pure virtual functions have practical value in the real world?

Yes. An abstract class is a conceptual class (an incomplete class) that provides a generic interface for two or more actual classes (the derived classes). For instance, a shape is not an actual object, nor is a mammal. They are simply a type of object; a conceptual object. A square is an actual type of shape, just as a golden Labrador is a specific breed of dog, an actual mammal. The conceptual classes merely provide a generic interface to the actual object, but do not have enough information to implement that interface. For instance, all shapes can be drawn, but without knowing what type of shape to draw, the conceptual shape cannot implement the draw method, it can only provide the interface. By declaring the shape::draw method to be pure-virtual, you not only ensure that you cannot instantiate a shape by itself (it is merely an abstraction), you also ensure that all the derivatives of the shape class provide a specific implementation of that interface.


In C plus plus is it possible to instantiate an array without specifying a length?

No. You can declare a dynamic array without specifying a length, but in order to physically instantiate (either by using malloc or by using object-oriented construction) you must provide a length.


How is the using pattern useful What is IDisposable How does it support deterministic finalization?

The using statement defines a scope at the end of which an object will be disposed. You create an instance in a using statement to ensure that Dispose is called on the object when the using statement is exited. A using statement can be exited either when the end of the using statement is reached or if, for example, an exception is thrown and control leaves the statement block before the end of the statement. The object you instantiate must implement the System.IDisposable interface. IDisposable is a very special interface. It is meant to be used with the "using" key word so it is very different than most any other interface as it has compile time support. It is meant for _exception safe_ deterministic cleanup of resources.


How do you create an object type object in c plus plus?

An object is simply an instance of a class. #include<iostream> class my_object {}; int main() { my_object X; // instantiate an instance of the class my_object, identified as X. }


What is the difference between inheritance and delegation?

When you inherit you typically override and specialise the virtual methods of the base class. With delegation, you embed a member object in your class and provide an interface (often a simplified interface) to that embedded object. Each embedded object takes care of itself, the container merely provides an interface and delegates the calls to the object itself.