Question:
1)What are the actual functions of JVM? 2)When to use a class and when to use an Abstract class? 3)what is the use of constructors other than creation of objects? 4)when to use constructors? 5)when to use Interface? 6)why java does not support pointers? 7)why multiple inheritance is not possible in java without using Interfaces?
Answer:
Various function are performed by JVM like garbage collection ,loading class, interpretation of bytecode. Main funtion of JVM is to provide the interfacing between hardware & our JAVA program.It is the platform for execution of JAVA bytecode. Source: CoolInterview.com
Answered by: Rahul Pande | Date: 2/12/2008
| Contact Rahul Pande
1) To work with any java pgm we need to have JVM installed.It will interpret the java API to underlying hardware.
2)When you dont want to instantiate object for a class declare that class as Abstract. whose methods can be overridden only in the subclass which extends it.
3)Constructors are used for initializing values to data members. which has no return values but same name as that of the class name.
5)Java does not support multiple inheritance.to overcome that we use interface
6)Pointer is a variable that holds address of another variable.It is possible for pointers to hold address of a variable that lies outside java environment which breaches the firewall of java environment
7)Multiple inheritance has got 2 disadvantages gives rise to ambiguities.to overcome all that java doesnot support multiple inheritance. Source: CoolInterview.com
Answered by: ramya | Date: 4/14/2008
| Contact ramya
When to use constructor ?
when you want to initialised an objects at runtime for a class then you can use constructor Source: CoolInterview.com
Answered by: Aditya Pant | Date: 5/15/2008
| Contact Aditya Pant
5)when to use Interface? Interface is used instead of multiple inheritance.because multiple inheritance not support in java. By using interface we can implements more than one class through implements keyword. Source: CoolInterview.com
Answered by: prabha | Date: 8/9/2008
| Contact prabha
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.
|