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 difference between checked exception and unchecked exception?
What is the purpose of static keyword in java?
What does += mean coding?
What is the structure of java?
What happens when main () method is declared as private?
What is difference between fail-fast and fail-safe?
What is preparedstatement in java?
Which is faster string or stringbuilder?
What are the differences between processes and threads?
What are the types of relation?
What will be the initial value of an object reference which is defined as an instance variable?
What is maximum size of arraylist in java?
How can you traverse a linked list in java?
What is derived datatype?
How do you find the independent variable?