cop3xxxreview

cop3xxxreview - Review Q1. Given the following piece of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Review Q1. Given the following piece of code: public class A { public A(){} } public class B extends A { public B(){} } public class driver { public static void main(String[] arg) { A a = new B(); B b = new A(); } } What will happen when you try to compile it? Explain. Q2. Given the following piece of code: abstract class A { A(){ } int abstract method1(); void abstract method2(); } abstract class B extends A { super(); int method2() { return 0; } } What will happen when you try to compile it? Explain. Q3. Indicate true or false for the following statements. (i) A final class can have instances. (ii) A final class can be extended. (iii) A final class can be implemented. (iv) An abstract class can be extended (v) An abstract class cannot be inherited. (vi) A concrete class does not have to define all of the abstract methods that it inherits from an abstract class. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Q4. What output is generated from the following program? class A
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/06/2012 for the course COP 3804 taught by Professor Staff during the Fall '08 term at FIU.

Page1 / 3

cop3xxxreview - Review Q1. Given the following piece of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online