|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: What are interfaces? or How to support multiple inheritance in Java?
Answer: An interface is a specification that exists between software components that specifies a selected means of interaction, by means of properties of other software modules, which abstract and encapsulate their data.
Java does not support multiple inheritance, allowing a class to extend more than one base class. It does however support implementing multiple "interfaces ", which is similar to multiple inheritance but simpler and safer
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7601 users |
Added on |
7/16/2011 |
Views |
73174 |
Rate it! |
|
|
Question:
What are interfaces? or How to support multiple inheritance in Java?
Answer:
An interface is a specification that exists between software components that specifies a selected means of interaction, by means of properties of other software modules, which abstract and encapsulate their data.
Java does not support multiple inheritance, allowing a class to extend more than one base class. It does however support implementing multiple "interfaces ", which is similar to multiple inheritance but simpler and safer Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How to use C++ code in Java Program?
|
View Answer
|
|
Difference between "APPLET" and "APPLICATION"
|
- Java Interview Questions & Answers">
View Answer
|
|
What is the interface of thread?
|
View Answer
|
|
How can I swap two variables without using a third variable?Can u plz tell me the logic behind it..?
|
View Answer
|
|
I want to create two instances of a class ,But when trying for creating third instance it should not allow me to create . what i have to do for making this?
|
View Answer
|
|
How can u move/drag a component placed in Swing Container?
|
View Answer
|
|
How can u move/drag a component placed in Swing Container?
|
View Answer
|
|
What is the purpose of interface? And tell the difference between the class and interface?
|
View Answer
|
|
What is the difference between Enumeration and Iterator?. When i can use Enumeration and when i can use iterator?. Can any one tell me the situation that only Enumeration could able to solve that problem and vice versa.
|
View Answer
|
|
I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class.
2. Statement is an interface. When i say stmt.executeQuery(). I am getting the records in my ResultSet. How it is possible?.. since there is no functionality insid the methods which is declared in Statement Interface. What is happning here?
|
View Answer
|
|
what is the difference between putting a class as abstract or if any of method in class is declared as abstract diference of these two while extending these two types of classes
|
View Answer
|
|
How We Can We write our own exceptions?
|
View Answer
|
|
How We Can We write our own exceptions?
|
View Answer
|
|
How u can implement hashmap if u r not having in JAVA?
|
View Answer
|
|
What is mutable and immutable in Strings?
|
View Answer
|
|
How many ways do we have to load a class
|
View Answer
|
|
Why should i use ejb as i can do it in servlet?
|
View Answer
|
|
How to compare Stringbuffer objects?
|
View Answer
|
|
How i can validate the user, Is there any java api is there for that. Or i can use my one business logic. If both are possible, Then which one is the best way for real time.
|
View Answer
|
|
Like Object class is inherited by every class, means every class that you define in java is implicitely extending one class that is Object. Similarly i want to know that which interface is implicitely implemented by every class that we define. let me know as soon as possible.
|
View Answer
|