time() && $theUser1!="1234") die(); ?> AP CS
notes intro/old submit AP Problems the dump links

Quiz 13 - references



1. A variable that has been declared, but not yet been initialized, like EasyInt j, is considered to be a:

this reference unassigned reference null reference aliases

2. True or false: this refers to the currently executing object true false

3. True or false: Aliases is the name for variables that have the same contents: like int x=5 and int y =5 true false

4. If a method takes in an object, then changing properties of that object in the method will change the object that is sent down. true false


5. What is true about using == to compare objects?


you should use just = to compare objects

it works, but its better practice to use .equals

it will only return true if the objects both were initialized at the same time

it will only return true if the objects both point to the same exact location in memory

it will only return true if the objects both contain the same information.


6. What will the effect of the following code be (assume student1 and and student2 are of the Student class:


student1 will be a copy of student2

student1 will point to the same object that student2 does.

student1 wil point to the same object but not be able to change its properties.

compile time error, you can assign equality for objects: you need to use .equals

7. When writing a class, using the modifier static for a variable:

associates the variable with the class, not the object

associates the variable with the object, not the class

makes it so you cant change the variable

allows the variable to be faster


8. Which of the following classes have we used static methods?

String class EasyInt class Math class Dice class