Java Programming Questions & Answers: part13



Software Programming : Java Programming QUESTIONS AND ANSWERS :: part13 : 1 to 5

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

1.What will be the value of i for the following loop? int y = 0; for (int i = 0; i<10; ++i) { y += i; }

9
10
11
12
Undefined.

2.Which of the following provides the naming services for the server to register the object and for the client to locate the object?

Server object interface
Server implementation
RMI Registry
Server stub
Server Skeleton.

3.Which of the following statement is not defined in the Object class?

sleep(long milliseconds)
wait()
notify()
notifyAll()
toString().

4.What is the correct signature of the main method?

public static main(String[] args)
public static void main(String[] args)
public static void main(String[] )
public static void main(String args)
public void main(String[] args).

5.Analyze the following code: public class Test { int x; { x++; } }

The program cannot be compiled, because the statement x++ must be placed inside a method or a constructor
You cannot construct an instance of Test, because it does not have a constructor
When you construct an instance of Test, the value of x becomes 0;
When you construct an instance of Test, the value of x becomes 1;
When you contruct an instance of Test the value of x become -1.

More Java Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
Too many of us are not living our dreams because we are living our fears.- Les Brown