Java Programming Questions & Answers: part5



Software Programming : Java Programming QUESTIONS AND ANSWERS :: part5 : 6 to 10

Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :

6.In object oriented programming new classes can be defined by extending existing classes. This is an example of:

Encapsulation
Interface
Composition
Inheritance
Aggregation.

7.What is the error in the following class definitions? Abstract class xy { abstract sum (int x, int y) { } }

Class header is not defined properly.
Constructor is not defined.
Method is not defined properly
Method is defined properly
No error.

8.Polymorphism

Is not supported by Java
Refers to the ability of two or more objects belonging to different classes to respond to exactly the same message in different class-specific ways
Simplifies code maintenance
Not simplifies code manintenance
Refers to the ability of two or more objects belonging to different classes to respond to exactly the same message in different class –specific ways and simplifies code maintenance.

9.Which of the following does not belong: If a class inherits from some other class, it should #65. Which of the following does not belong: If a class inherits from some other class, it should

Make use of the parent class's capabilities
Over-ride or add the minimum to accomplish the derived class' purpose
Over-ride all the methods of its parent class
Make sure the result "IS-A-KIND-OF" its base class
Make sure the result “contains” its base class.

10.Which of these field declarations are legal within the body of an interface?

Private final static int answer = 42
public static int answer=42
final static answer =42
int answer
No error.

More Java Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
A real entrepreneur is somebody who has no safety net underneath them. Henry Kravis