CS100, Spring 2000, Exercise 9

Complete this form before lecture on Thursday, 4/27

Name (Last, First, Middle):

ID:

Please type in a day in the form "month+day", e.g. october+1, feb+28. The day should be either your birthday or a random day you generate as an integer from 1..365.

Some days will be chosen more than once. What is your guess as to the maximum number of times any single day is chosen?

Please answer questions Q1, Q2, Q3 about the code below.

public class A {
    public static int a1;
    public int a2;

    public static void A3(int a4) {
        // *** Q1 ***
    }

    public A(int a5) {
        // *** Q2 ***
    }
}

public class B extends A {
    public B() {
        // *** Q3 ***
    }
}

Q1) Which variables and methods are visible at Q1?
a1 a2 A3 a4 A a5 A.a1 A.a2 B.a1 B.a2
don't know
yes
no
nonsense

Q2) Which variables and methods are visible at Q2?
a1 a2 A3 a4 A a5 A.a1 A.a2 B.a1 B.a2
don't know
yes
no
nonsense

Q3) Which variables and methods are visible at Q3?
a1 a2 A3 a4 A a5 A.a1 A.a2 B.a1 B.a2
don't know
yes
no
nonsense