CSII Final Review
How many bits are in a byte?
8
Programming languages evolved in three stages: high level, assembly, and machine languages. Which was created first?
Programming languages evolved in three stages: high level, assembly, and machine languages. Which was created first? Machine Languages
When compared byte for byte, which is more expensive, RAM or typical hard drive space?
When comparted byte for byte, which is more expensive, RAM or typical hard drive space? RAM
Name a type of system software.
Windows 8
Convert the binary number to hexadecimal.
17
True or False Java and C++ are object oriented languages.
True
Provide an example of an extended assignment operator.
+=, -=, *=, /=, %=
Provide an example of a relational operator.
, =, !=, ==
Which logical operator has the highest precedence?
!
The statement below creates a random number in what range? (int)(Math.random() * 7 + 1)
The statement below creates a random number in what range? (int)(Math.random() * 7 + 1) [0, 1) [0, 7) [1, 8)
What is the value of var? int var = (7 – 3 % 4 * 5);
What is the value of var? int var = (7 – 3 % 4 * 5); -8
When two reference variables refer to the same object, this is known as…
aliasing
TRUE/FALSE Static variables should be named with all capital letters.
TRUE/FALSE Static variables should be named with all capital letters. False – final variables are named with all capital letters
What is the difference between a concrete and abstract class?
An abstract class cannot be instantiated.
What will be the ending value of var? int var = 7; if( var < 10) var = 12; if(var < 20) var = 25; if(var < 30) var = 7;
What will be the ending value of var? int var = 7; if( var < 10) var = 12; if(var < 20) var = 25; if(var < 30) var = 7; //7
What will the code below print? System.out.println(5/2* );
What will the code below print? System.out.println(5/2* ); 7.3
In the method below, the variable temp has what type of scope? public void mystery(){ for(int i = 0; i < 10; i ++){ int temp = 15; System.out.print(temp / i ); }
In the method below, the variable temp has what type of scope? public void mystery(){ for(int i = 0; i < 10; i ++){ int temp = 15; // Block Scope System.out.print(temp / i ); }
What is the value of var? int[][] arry = new int[5][10]; int var = arry.length + 7;
What is the value of var? int[][] arry = new int[5][10]; int var = arry.length + 7; // = 12
Let X be an interface and Y be an abstract class. Z is a concrete subclass of Y that implements the X interface. List all possible instantiations involving X, Y, and Z. ** Assume that a no-argument constructor for Z exists.
Let X be an interface and Y be an abstract class. Z is a concrete subclass of Y that implements the X interface. List all possible instantiations involving X, Y, and Z. X x = new Z(); Y y = new Z(); Z z = new Z();