can you create interface instance ?

Answers were Sorted based on User's Feedback



can you create interface instance ?..

Answer / prakash

!!!!!!!!!!!!!!!!!!marvelous!!!!!!!!!!!!!

Is This Answer Correct ?    2 Yes 23 No

can you create interface instance ?..

Answer / guest

sdfg

Is This Answer Correct ?    35 Yes 59 No

can you create interface instance ?..

Answer / anil

Uday..........Plz change ur name to James Gosling
Jr......dat suits u

Is This Answer Correct ?    0 Yes 28 No

can you create interface instance ?..

Answer / udaykiran

Why Not?
Yes, Even we can create an instance of interface and
abstract class also.
just see this below simple example

Main.java
-----------
interface Test
{
public void wish();
}
class Main
{
public static void main(String[] args)
{
Test t=new Test()
{
public void wish()
{
System.out.println("output: hello how r u");
}
};
t.wish();
}
}

cmd> javac Main.java
cmd> java Main
output: hello how r u

in above case Test is an interface but i created the object
for that interface.

Is This Answer Correct ?    54 Yes 92 No

Post New Answer

More Core Java Interview Questions

What is import java util arraylist?

0 Answers  


What is compile time polymorphism?

20 Answers   CTS, Elementus Technologies, Oracle,


What is a resource leak ?

1 Answers  


How can we make a class singleton?

0 Answers  


What flag up means?

0 Answers  






What are green threads in java?

0 Answers  


What is the frontend and backedn in Java?

3 Answers   TCS,


Can you declare an interface method static?

0 Answers  


What are different types of states exist for a thread?

0 Answers  


How does a for loop work?

0 Answers  


How does linkedhashmap work in java?

0 Answers  


what are the diffrences between interface and abstract class?

4 Answers  


Categories