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
Is the empty set a singleton?
What is a programming object?
What are the types of methods in java?
What are synchronized methods ?
What is the purpose of the System class?
Why does abstract class have constructor?
How do you use spaces in java?
Differentiate between run time error and syntax error.
Write a function to print Fibonacci series and Tribonacci series?
How to find the given number is a prime number or not by getting input from the user
Explain what do you mean by functional overloading in java?
Which of the following is not an isolation level in the JDBC
hr interview how many minutes asking question
Is vector ordered in java?
When should I use a singleton?