midterm_review

midterm_review - C. boolen, char, bit, short, int, long,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 302 Midterm Review Questions 1 True or False 1. To construct a Rectangle object, one might use the following code: Rectangle r = new(5,10,20,30); 2. An int can store larger numbers than a long . 3. String is a primitive type. 4. The following is a valid if statement: if (x <= 5) then System.out.println("Sweet!"); 5. The CPU just stores information while RAM actually runs programs. 6. It is possible that the loop body of a while loop will never be executed. 7. The public access speciFer means that any other class can access the instance Feld or method described. 8. A sentinel loop is one which always executes a set number of times. 9. The following is a valid boolean expression: 5 <= x != 8 2 Multiple Choice 1. The Java numeric primitive types are: A. byte, short, int, long, float, double B. boolean, char, bit, short, int, long, float, double
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C. boolen, char, bit, short, int, long, float, double , and references D. bit, short, int, long E. bit, short, int, long, float, double 1 2. What value would Java produce by evaluating the expression 16 % 5 / 6 + 29 / 2 % 7 ? A. 2 B. 3 C. 0 D. 4 E. 1 3. What character sequence denotes the end of a comment block? A. * \\ B. */ C. ** D. \ E. \ * 4. How many times does the following code print zzz: for(int i = 0; i <= 2; i++) for(int j = 1; j <= 1; j++) System.out.println("zzz"); A. 0 B. 1 C. 2 D. 3 E. 4 3 Written Questions 1. Be able to write instantiable classes 2. Be able to write tester classes 3. Be able to write or trace nested loops 4. Be able to write or trace nested if statements 5. Be able to trace Fow diagrams 2...
View Full Document

This note was uploaded on 08/08/2008 for the course CS 302 taught by Professor Willbenton during the Spring '07 term at Wisconsin.

Page1 / 2

midterm_review - C. boolen, char, bit, short, int, long,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online