can you create interface instance ?
Answer Posted / naresh jangili
no we can't create an object to interface and also abstract because two classes are un implememnted class for every un implemented classes we can create only reference varable.
but for every implemented classes we can create objects.
eg: interface A{
public void test()
}
class B implementes A
{
public void test()
{
s.o.p("hello");
}
public static void main(String argss[])
{
B b=new B(); (object creation)
A a1=null; (reference variable)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Define how objects are stored in java?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What are the Main functions of Java?
How to sort elements in a parallel array in java?
What is a ternary operator in java?
How will you print number in reverse (descending) order in BST.
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What carriage return means?
What is a platform?
What is currentthread()?
What are the different ways of creating thread?
What is hashing in java?
How do you access command-line arguments within the code?
What is the function of character?
How to convert string to byte array and vice versa?