Java Programming Questions & Answers: part6



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

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

6.What will be the result of the expression 13 & 25?

38
25
9
12
21.

7.Which of the following has a method names flush( )? #80. Which of the following has a method names flush( )?

Input stream
Output Stream
Reader stream
Input reader stream
Input output stream.

8.What will be the result of attempting to compile the following program? public class MyClass { long var; public void MyClass(long param) { var = param; } //(1) public static void main(String[] args) { MyClass a,b; a = new MyClass(); //(2) b = new MyClass(5); //(3) } }

A compilation error will occur at (1), since constructors cannot specify a return value
A compilation error will occur at (2), since the class does not have a default constructor
A compilation error will occur at (3), since the class does not have a constructor which takes one argument of type int
The program will compile correctly
The program will compile and execute correctly.

9.Which of the following statements are true regarding the finalize( ) method?

The finalize ( ) method must be declared with protected accessibility
The compiler will fail to compile the code that explicitly tries to call the finalize( ) method
The body of the finalize ( ) method can only access other objects that are eligible for garbage collection
The finalize ( ) method can be overloaded
The finalize() method cant be overloaded.

10.Which of the following is true in regard to applet execution?

Applets loaded from the same computer where they are executing have the same restrictions as applets loaded from the network.
Applets loaded and executing locally have none of the restrictions faced by applets that get loaded from the network.
Applets loaded and executing locally have some restrictions faced by applets that get loaded from the network.
Applets cant react to user input and change dynamically
Applets can be run independently.

More Java Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Identify your problems but give your power and energy to solutions- Tony Robbins