Tablas

Solo disponible en BuenasTareas
  • Páginas : 4 (953 palabras )
  • Descarga(s) : 0
  • Publicado : 30 de noviembre de 2010
Leer documento completo
Vista previa del texto
1. Which statement(s) are true? (Choose all that apply.)
A. Has-a relationships always rely on inheritance.
B. Has-a relationships always rely on instance variables.
C. Has-arelationships always require at least two class types.
D. Has-a relationships always rely on polymorphism.
E. Has-a relationships are always tightly coupled.

2. Given:
class Clidders {
publicfinal void flipper() {
System.out.println("Clidder"); }
}
public class Clidlets extends Clidders {
public void flipper() {
System.out.println("Flip a Clidlet");super.flipper();
}
public static void main(String [] args) {
new Clidlets().flipper();
}
}
What is the result?
A. Flip a Clidlet
B. Flip a Clidder
C. Flip a Clidder
Flip a ClidletD. Flip a Clidlet
Flip a Clidder
E. Compilation fails.
3. Given:
public abstract interface Frobnicate { public void twiddle(String s); }
Which is a correct class? (Choose all that apply.)A.
public abstract class Frob implements Frobnicate {
public abstract void twiddle(String s) { }
}
B.
public abstract class Frob implements Frobnicate { }
C.
public classFrob extends Frobnicate {
public void twiddle(Integer i) { }
}
D.
public class Frob implements Frobnicate {
public void twiddle(Integer i) { }
}
E.
public class Frob implementsFrobnicate {
public void twiddle(String i) { }
public void twiddle(Integer s) { }
}
4. Given:
class Top {
public Top(String s) {
System.out.print("B");
}
}
publicclass Bottom2 extends Top {
public Bottom2(String s) {
System.out.print("D");
}
public static void main(String [] args) {
new Bottom2("C");
System.out.println(" ");
}
}What is the result?
A. BD
B. DB
C. BDC
D. DBC
E. Compilation fails.
5. Select the two statements that best indicate a situation with low coupling. (Choose two.)
A. The attributes...
tracking img