1.Which two demonstrate an “is a” relationship? (Choose Two)
A. public interface Person { }
public class Employee extends Person { }
B. public interface Shape { }
public class Employee extends Sha pe { }
C. public interface Color { }
public class Employee extends Color { }
D. public class Species { }
public class Animal{private Species species;}
E. interface Component { }
Class Container implements Component (
Private Component[ ] children;
Answer :de
2. Given:
1. package foo;
2.
3. public class Outer (
4. public static class Inner (
5. )
6. )
Which statement is true?
A. An instance of the Inner class can be constructed with “new Outer.Inner ()”
B. An instance of the inner class cannot be constructed outside of package foo
C. An instance of the inner class can only be constructed from within the outer class
D. From within the package bar, an instance of the inner class can be constructed with “new inner()”
Answer:c
3.Exhibit:
1 public class enclosinggone{
2 public class insideone{}
3 }