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
In the below example, how many string objects are created?
Is array size fixed in java?
Does java vector allow null?
What must a class do to implement an interface in java programming?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
Can a singleton class be inherited?
What does main method?
What is purpose of find feature?
What is the use of parseint in java?
Is string is a data type?
Why java is considered dynamic?
What do you mean by global variable?
What is the use of flag?
Why main() method is public, static and void in java ?
Can we override the private methods?