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.

Examine the following class definitions to detect errors, if any.
abstract class MyPanel

  1 Error. Method show() should have a return type

  1 Error. Method show() is not implemented in MyDisplay

  1 Error. MyDisplay does not contain any members

  No errors

  Half-n-half Clue
 

3.

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

  @value

  @argument

  @parameter

  @param

  @method

  Half-n-half Clue
 

4.

Examine the following code snippets to identify the legal loop constructs:
(A) for (int i = 22, int j = 0; i + j > 11; i = i-3, j++)

  (A) & (D)

  (A) & (C)

  (A)

  (B)

  Half-n-half Clue
 

5.

Determine the output when the value of x is zero:
if(x >= 0)
if(x > 0)
System.out.println("x is positive");
else
System.out.println("x is negative");

  "x is positive" and "x is negative"

  "x is negative"

  None of these

  "x is positive"

  Half-n-half Clue
 

6.

What will be the output of the following program?
class Main2

  Error. Won't compile

  YYY

  XXX followed by YYY

  XXX

  Half-n-half Clue
 

7.

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
 


 
12 more pages in Java Programming


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