(You can go to the MathCS lab, login to one of the machines and print it out. Pick up your print outs by the lab rep (at the entrance of the MathCS lab). You can also print in the library, but that will cost you some money).
You must use the answer sheet - grading paper homeworks in random format has proven to be quite difficult.
double a = 11.0, b = 4.0; int i = 11, j = 4; |
Using the given values above in the variables a, b, i and j, for each of the following Java println statements, state:
(Note: you can answer these questions using the Java compiler, and if you do this, you will miss out on a chance to learn. Also you will be asked to do similar problems like these on the midterm and you will not have access to a Java compiler.
But I do recommend you write these statement inside a Java program after you have do the homework. The Java program can check your answers --- if you have errors, try to find out why !!! So: use the Java compiler to help you learn Java programming !)
|
Note: Java has the
the unary + operator
that returns the same value (identity operation).
E.g.: +3 = 3.
|
For each package, write down the first sentence of the package description, and report how many classes it contains. (Just count classes, not interfaces, exceptions, or whatever else.)
For example, if we had asked for java.awt.color, the answer would be:
|
public class Question3 { public static void main( String[] args ) { } }
Make sure you import the necessary classes in your program.
|