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
What is the purpose of javac exe?
What are basic keywords?
Explain when noclassdeffounderror will be raised ?
What is array initialization in java?
What is illegal identifier in java?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
What do you mean by synchronized non access modifier?
What is the byte range?
What is executor memory?
Is vector thread safe in java?
How do you pass by reference?
What are abstract methods in java?
How do you allocate memory to object?
What is formatted output in java?
What is locale?