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 an association?
Write a program to print count of empty strings in java 8?
What is the static variable?
Is string thread safe in java?
what is enumset?
What does singleton class mean?
What is the difference between Java and C++?
What is Session reduplication and how its done?
What is a parent class in java?
Can we use String with switch case?
What is the static block?
Can substring create new object?
What is unicode full form?
What is the difference between overriding and overloading in OOPS.
What are JVM.JRE, J2EE, JNI?