Can we instantiate Interfaces?

Answer Posted / bharat vandar

No we can instantiate interface directly.but we can create
instantiate of interface in directly,only class can create
an object of interface


interface x
{
public void abc();
}
class ac implements x
{
x at = new ac();

public void abc()
{
System.out.println("Bharat");
}
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between ++ I and I ++ in java?

535


When should we create our own custom exception classes?

589


What is a lightweight component?

599


Can a lock be acquired on a class in java programming?

536


Write a program to find maximum and minimum number in array?

555






How to perform selection sort in java?

588


What is the difference between replace and replace all?

479


how can i use a nonsynchronized hashtable?

2110


Which is dependent variable?

498


What is final keyword?

648


Where is stringbuffer stored?

553


How are variables stored?

533


How do you sort in descending order in java using collections sort?

506


What is hashmap in java?

573


How do you check if a string contains only numeric digits?

620