why do we use interface in java?

Answer Posted / navinice

We use Interfaces in java because JAVA Doesn't support
multiple inheritance. Thats why no any class can extend more
than one class in JAVA.. But through Interfaces we can
implement more than one interfaces and use there methods in
base class.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???

1901


Can we override protected method in java?

811


What is user defined exception in Java?

837


How many types of string data types are there?

758


What is the default size of set in java?

710


Explain the significance of class loaders in bootstrap?

710


Can size_t be negative?

799


What is a generic data type?

744


Is java a utf 8 string?

746


What must a class do to implement an interface in java programming?

743


Can we restart a dead thread in java?

746


What is scope of a variable?

830


What is the difference between class & object?

769


Is jdk required on each machine to run a java program?

1007


What is style and indentation?

765