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 language is pass by reference?
What are the advantages of packages in java?
What's the difference between int and integer in java?
When is the finalize() called?
What is incompatible types in java?
What is a flag value?
What is Java Shutdown Hook?
What are internal and external variables?
What are 5 boolean operators?
Write a java program to count the number of words present in a string?
What are the benefits of java?
Why we use methods in java?
Is string is a class in java?
What is thread pool in java with example?
Is singleton class immutable?