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

Is alive method in java?

0 Answers  


Explain different forms of polymorphism?

0 Answers  


What is the parse method in java?

0 Answers  


Explain creating threads by implementing runnable class?

0 Answers  


Why does java have different data types for integers and floating-point values?

0 Answers  






What is internal variable?

0 Answers  


Define linked list and its features with signature?

0 Answers  


What is string immutability?

0 Answers  


what do you mean by classloader in java?

0 Answers  


Is boolean a wrapper class in java?

0 Answers  


What is the use of static keyword in "public static void main()"

10 Answers   College School Exams Tests, Infosys, Six Dee Telecom,


What is OOPS Concept?

1 Answers   Cap Gemini,


Categories