tutorial 5
Download
Skip this Video
Download Presentation
Tutorial 5

Loading in 2 Seconds...

play fullscreen
1 / 6

Tutorial 5 - PowerPoint PPT Presentation


  • 97 Views
  • Uploaded on

Tutorial 5. Superclasses , Subclasses and Inheritance. Classes can be  derived  from other classes, thereby  inheriting  fields and methods from those classes Subclass  - derived class ( Specialised ) Superclass – inherited class ( Generic )

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Tutorial 5' - nasya


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
tutorial 5

Tutorial 5

Superclasses, Subclasses and Inheritance

inheritance
Classes can be derived from other classes, thereby inheriting fields and methods from those classes
  • Subclass - derived class (Specialised)
  • Superclass – inherited class (Generic)
  • Basic Idea: Inherit everything from Superclass and extend its abilities
Inheritance
overriding methods
Overriding:  Subclass modifies the implementation of a method defined in the Superclass
  • Car c2 = new Porsche();

c2.makeSound(); //”Porsche vroommm!

  • Java always uses methods and variables of the more “specialised” class
Overriding Methods
midterm review
http://exams.library.utoronto.ca.myaccess.library.utoronto.ca/browse?type=subject&order=ASC&rpp=20&value=CSC207H
  • Practice the questions that seem relevant!
MIDTERM REVIEW
slide6
CommaSeparatedValues (CSV)
  • You are writing Parser/Evaluator
  • Syntax specified by CFG
  • OO design (CRC cards) will help you create a tree for evaluating recursively!
A1
ad