can you create interface instance ?

Answer Posted / rasmitha

No,But we can Create reference for interface.
For Example.

java.sql.Connection is an interface,But in the
Establishmentof the Database Connetion.

Connection con = DriverManager.getConnetion();

con is an ref Varieble that holds Connetion Object yar..

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to add menushortcut to menu item?

557


what are synchronized methods and synchronized statements? : Java thread

571


What does business logic mean?

497


how can you catch multiple exceptions in java?

535


How to display names of all components in a Container?

2482






What is indexof in java?

506


What is the difference between Java and C++?

604


What is jpa specification?

531


What are peerless components?

611


Java Compiler is stored in JDK, JRE or JVM?

1042


What is a void method java?

506


Define nashorn in java8.

561


Does java map allow duplicates?

483


What is the requirement of thread in java?

609


What do you understand by garbage collection in Java? Can it be forced to run?

543