1/3/08 Notes

To Notes

CSC 212 -- 1/3/08

 

Useful URLs:

 

Pretest

  1. What are the meanings in Java for each of the following symbols?

    Answers:

  2. Write Java code to create an array of int with elements 3, 7, and 9.

    Answer: Recall that there are three steps to creating and using an array:

    1. Declaring the array reference variable.
    2. Creating the space for the array.
    3. Assigning values for the array elements.

  3. What are the rules for creating Java variable names?

    Answer: Variable names must start with a letter and consist of letters and digits. They should not be more than about 15 characters long and should be a meaningful description of what the variable contains.

  4. List some Java methods for input and output.

    Answer: JOptionPane.showInputDialog, JOptionPane.showMessageDialog, System.out.print, System.out.println, System.out.printf. Some methods of the Scanner class are next, nextInt, nextDouble.

 

Some Input/Output Examples

 

Java Datatypes

 

Java Operators

 

Binary and Hex Numbers

 

Project Proj1