Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Computer Science for Majors II CPSC 233, Winter 2013 CPSC 233, winter 2013 Tutorial 14, Mar 27/28, 2013.

Similar presentations


Presentation on theme: "1 Introduction to Computer Science for Majors II CPSC 233, Winter 2013 CPSC 233, winter 2013 Tutorial 14, Mar 27/28, 2013."— Presentation transcript:

1 1 Introduction to Computer Science for Majors II CPSC 233, Winter 2013 CPSC 233, winter 2013 Tutorial 14, Mar 27/28, 2013

2 Outline Review Quiz CPSC 233, winter 2013 2

3 Key Concepts Advanced Java Copy constructor Pass by value Pass by reference Static members Inheritance Private, protected, public Member inheritance Method overriding v.s method overloading Invoking of the constructors CPSC 233, winter 2013 2

4 4 UML Diagram (source code in practice1/) Parent - secret:int # familySecret:int + num:int + Parent() + method() + update() + toString():String Child1 - num1:int # num2:int + count:int + Child1() + method() + toString():String Child2 - num1:int # num2:int + Child2() + Child2(obj:Child2) + update() + update(n:int) + update(obj:Child1) + toString():String Answer the following questions based on the given program What are the data members that Child1 inherits from the superclass? What are the methods that Child1 inherits from the superclass? Identify method overriding in this program Identify method overloading in this program What is the output of the program (see Driver.java)?

5 5 UML Diagram (source code in practice2/) GrandParent - secret:int # familySecret:int + num:int + GrandParent() + method() + update() + toString():String Child1 - num1:int + count:int + Child1() + Child1(obj:Child1) + method() + update(obj:Child1) + toString():String Parent - num1:int # num2:int + Parent() + update() + update(n:int) + toString():String Answer the following questions based on the given program What are the data members that Child1 inherits from the superclass(es)? What are the methods that Child1 inherits from the superclass(es)? What are the data members that Parent inherits from the superclass? What are the methods that Parent inherits from the superclass? Identify method overriding in this program Identify method overloading in this program What is the output of the program (see Driver.java)?

6 Outline Review Quiz CPSC 233, winter 2013 6


Download ppt "1 Introduction to Computer Science for Majors II CPSC 233, Winter 2013 CPSC 233, winter 2013 Tutorial 14, Mar 27/28, 2013."

Similar presentations


Ads by Google