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 the difference between array list and vector in java?
What do you mean by data type?
What is difference between classpath and path variables in java?
What is the char data type?
How do you convert string to int in java?
Explain when we should make an instance variable private.
What is the difference between the boolean & operator and the && operator in java programming?
Explain the difference between call by refrence and call by value?
What does it mean that a method or field is “static”?
What is the difference between the final method and abstract method?
What is the maximum size of hashmap in java?
Is java a pure object oriented language?
Is string is a class in java?
What does opcode mean?
What is difference between equals and hashcode method?