Java Programming Questions & Answers: part8



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

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

1.How the main method header is written in Java?

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

2.Which of the following can Java run from a Web browser exclusively?

Applications
Applets
Servlets
Micro Edition programs
All of the above.

3.Which statement is true?

If an exception is thrown during the execution of the finalize() method of an eligible object, then the exception is ignored and the object is destroyed
All objects have a finalize() method
Objects can be destroyed by explicitly calling the finalize() method
The finalize() method can be declared with any accessibility
The compiler will fail to compile code that defines an overriding finalize() method that does not explicitly call the overridden finalize() method from the superclass.

4.Given the following class definitions and the reference declarations, what can be said about the statement y = (Sub) x? // Class definitions: class Super { } class Sub extends Super { } //Reference declarations // . . . Super x; Sub y;// . . .

Illegal at compile time
Legal at compile time, but might be illegal at runtime
Definitely legal at runtime, but the (Sub) cast is not strictly needed
Definitely legal at runtime, and the (Sub) cast is needed
None of the above.

5.Which of the following statements is true?

The keyword extends is used to specify that an interface inherits from another interface
The keyword extends is used to specify that a class inherits from an interface
The keyword implements is used to specify that an interface inherits from another interface
The keyword implements is used to specify that a class inherits from another class
None of the above.

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