Quiz #1
Wednesday
With a piece of paper, write down your name and answers to for following questions.
Which of the following is a valid
println
statement?System.out.println + "Hello World";
out.System.println("Hello World");
println.out("Hello World");
- None of the above is valid
&&
,||
, and!
are ____.- relational operators
- logical operators
- conditional operators
- ternary operators
This type of method does not return a value
- null
- void
- empty
- anonymous
Find the error in the following class:
public class MyClass { private int x; public void MyClass(int a) { x = a; } }
Correction:
public class MyClass { private int x; public MyClass(int a) { x = a; } }
Student Performance and Statistics
A histogram of student performance on percentage grades for Quiz 1 on Wednesday.
A table showing the average performance for each question in Quiz 1 on Wednesday.
Friday
With a piece of paper, write down your name and answers to for following questions.
These characters mark the beginning of a single-line comment.
//
/*
*/
/**
This type of expression has a value of either
true
orfalse
.- binary expression
- decision expression
- unconditional expression
- boolean expression
What will the
println
statement in the following program segment display?int x = 5 System.out.println(++x);
- 5
- 6
- 0
- None of these
Find the error in the following method.
public static double timesTwo(double num) { double result = num * 2; }
Correction:
public static double timesTwo(double num) { double result = num * 2; return result; }
Student Performance and Statistics
A histogram of student performance on percentage grades for Quiz 1 on Friday.
A table showing the average performance for each question in Quiz 1 on Friday.