Syvum Home Page

Home > Quiz Games > Java Programming >

Java Programming : Compilation and Execution: Multiple Choice


Answer the following questions about Java syntax and mistakes which can cause compilation errors, as well as the output generated by sample programs.

Formats Info Page Worksheet / Test Paper Quiz Review
Multiple choice

Your Performance  

1.

With javadoc, which of the following denotes a javadoc comment?

  /*

  //#

  /**

  //**

  Half-n-half Clue
 

2.

The method int func(int i, int j)

  (B) & (C)

  (C) & (D)

  (A), (B), (C) & (E)

  (A), (B) & (E)

  None of these

  Half-n-half Clue
 

3.

Which javadoc tag is used to denote a comment for a method parameter?

  @method

  @param

  @value

  @parameter

  @argument

  Half-n-half Clue
 

4.

What is java_g used for?

  To provide information about deprecated methods

  None of these

  Using the jdb tool

  Executing a class with optimization turned off

  Half-n-half Clue
 

5.

Which of the following command lines options generates documentation for all classes and methods?

  -public

  -private

  -protected

  -encoding

  -verbose

  Half-n-half Clue
 

6.

Which of the following expressions will produce errors upon compilation?
(A) boolean a = (boolean) 1;
(B) boolean b = (false && true);
(C) float y = 22.3;

  (A)

  (A), (B) & (D)

  (A), (C) & (D)

  (A) & (C)

  Half-n-half Clue
 

7.

Which lines of the following will produce an error?
1. byte a1 = 2, a2 = 4, a3;
2. short s = 16;
3. a2 = s;
4. a3 = a1 * a2;
(The lines are numbered only for illustration in this question.)

  Line 4 only

  Line 1 and Line 4

  Line 3 only

  Line 3 and Line 4

  Line 1 only

  Half-n-half Clue
 


 
12 more pages in Java Programming


Contact Info © 1999-2024 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright
Previous
-
Next
-