CSC1024 Quiz 1

Fall 2011
Herbert J. Bernstein ( )

CSC1024 Quiz 1
Fall 2011


This web page is
Copyright © 2007, 2011 Herbert J. Bernstein and other parties. All rights reserved.

This is the first weekly quiz to be taken on or before Tuesday, 13 September 2011. You should do it after you read the first 6 charpers of Hubbard. You should expect to spend 30 minutes to 2 hours on this quiz. You may use your text and any other resources to do this quiz, but if you do not know the answers well or are unable to discuss them in class, you will lose credit for the quiz.

  <==== Do this AFTER you've answered all the questions

You probably DON'T want to do this ===>  

Please fill in the following information:



Please answer the following questions on this form (or on a paper copy of this form).

  1. Write a complete working Hello World program in Java.

  2. Explain how to gain access to command line arguments.

  3. Explain the format and use of a Javadoc comment.

  4. Explain how to concatenate two Strings. Give a programming example.

  5. Explain how to convert a primitive type to a String.

  6. Explain the relationship between the String Class and the StringBuffer class.

  7. Explain how to get a random integer between 0 and 736.

  8. Explain the three logical operators and the if statement and give a programming example using each of the logical operators.

  9. Explain the switch statement.

  10. Explain the relationship between the switch statement and the if statement and give two equivalent programming examples.

  11. Write a method and a test program that, given an integer N computes the Nth Fibonacci number.

  12. Explain the role of a copy constructor.

  13. Explain the role of the equals method.

  14. Explain the role of the wrapper classes in Java with a code example.

  <==== Do this AFTER you've answered all the questions

You probably DON'T want to do this ===>  

Revised 14 August 2011