can you create interface instance ?
Answer Posted / john
@Uday Ur fooling amateur coders by creating an anonymous
class within the class . U cannot create an instance of an
Interface .If so try to make execute this code lol class
interface Test{
public void wish();
}
class Main
{
public static void main(String[] args)
{
Test t=new Test();
t.wish();
}
public void wish()
{
System.out.println("output: hello how r u");
}
}
Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
what is daemon thread and which method is used to create the daemon thread? : Java thread
Is string serializable in java?
Is vector ordered in java?
What is the meaning of variables in research?
What is comparable and comparator interface? List their differences
Explain 5 features introduced in jdk 1.7?
Can we declare an interface as final?
Is java a utf 8 string?
Which sort is best in java?
What are the parts of a method?
Is 0 an even number?
Explain the features of java?
how to split string in java?
Define array. Tell me about 2-D array.
What are variable arguments or varargs?