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
You're given a Boolean 2D matrix, can you find the number of islands?
Write the algorithm to check the number non-leaf nodes in a tree.
What is meant by object oriented programming – oop?
List some java keywords sun like c, c + + keywords?
What are unchecked exceptions in java?
How does remove work in java?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
What is jit compiler ?
Explain java thread life cycle.
What are the elements of java?
What is stringbuffer in java?
What are streams?
What are drawbacks of singleton class?
What is passing value java?
What do you understand by abstract classes?