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.

What is java_g used for?

  Using the jdb tool

  Executing a class with optimization turned off

  None of these

  To provide information about deprecated methods

  Half-n-half Clue
 

3.

Consider the following code:
int i = 1;
switch(c)

  code is illegal and therefore will not compile

  output will be One, followed by Two, and then followed by Three

  output will be One followed by Two

  output will be One

  Half-n-half Clue
 

4.

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

  -protected

  -encoding

  -private

  -verbose

  -public

  Half-n-half Clue
 

5.

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

  Error. Won't compile

  XXX

  YYY

  XXX followed by YYY

  Half-n-half Clue
 

6.

Which error does the following code contain: class Class1

  There is no error

  Class1 should be declared as abstract

  Method func1() must be declared as static

  Class Class1 has not been declared public

  Half-n-half Clue
 

7.

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

  @param

  @method

  @argument

  @value

  @parameter

  Half-n-half Clue
 


 
12 more pages in Java Programming


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