Answers Back to schedule page
Prev  Next
Quiz Number 8

SWE 432, Fall 2008
October 27
 

  1. Consider the following four class declarations. Note that Q, R and S are all in package P, but T and U are not.
    
    //----------------------------    |    //----------------------------
    package P;                        |    package P;
    public class Q                    |    public class R extends Q {...}
    {                                 |    //----------------------------
       public    int f;               |    package P;
       private   int g;               |    public class S {...}
       protected int h;               |    //----------------------------
                 int i;               |    public class T extends Q {...}
    }                                 |    //----------------------------
    //---------------------------     |    public class U {...}
                                      |    //----------------------------
    
    
    1. List all classes that can access variable f.

    2. List all classes that can access variable g.

    3. List all classes that can access variable h.

    4. List all classes that can access variable i.


  2. What language was Java originally based on?
    1. C++
    2. C
    3. C#
    4. Objective C
    5. Ada
    6. Pascal
    7. Perl
    8. JavaScript