Hayden Schiff
2013-10-25
AP Computer Science Bell 1
Ch. 5 book questions
>>>> SHORT ANSWER <<<<
>> 5.1 <<
hello
hello there
>> 5.3 <<
A static method is called on the class rather than on an instance, so the instance
variables do not have values when you call a static method.
>> 5.5 <<
public interface Visible {
public boolean makeVisible();
public boolean makeInvisible();
}
Classes could implement this interface by having a boolean "visible" that is set to true
by the former method and to false by the latter method.
>> 5.7 <<
[N.B. Because I'm doing this work on a tablet, I used multiple spaces in the place of each tab character] The output of the given code:
Before changing the values:
f1 f2 f3
27 38 49
After changing the values:
f1 f2 f3
999 888 777
anInteger: 27
aNum: 888
anotherNum: 49
>>>> MULTIPLE CHOICE <<<<
5.1: D
5.2: B
5.3: B
5.4: A
5.5: E
5.6: A
Comments