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 a newline character in java?

0 Answers  


What is a two-pass assembler?

0 Answers   Syntel, Visa,


Can we use both this () and super () in a constructor?

0 Answers  


why is S capital in System.out.println ????

6 Answers  


What is the main purpose of java?

0 Answers  


What do you mean by scope of variable?

0 Answers  


Can a class be private?

0 Answers  


Explain java coding standards for interfaces?

0 Answers  


How many ways can you break a singleton class in java?

0 Answers  


Can you write a java class that could be used both as an applet as well as an application?

0 Answers  


What do you understand by Header linked List?

0 Answers   Genpact,


How many techniques can be employed to create a string object?

0 Answers  


Categories