Inheritance Doing More with Your Classes. Review of Classes Collection of instance variables and instance methods Treated like a data type Encapsulation.

Slides:



Advertisements
Similar presentations
Geometry in real life title.
Advertisements

Let’s review our shapes….
Triangles and Quadrilaterals
Warm Up The lengths of three sides of a triangle are given. Classify the triangle , 12, , 10, , 15, 26 equilateral scalene isosceles.
Java™ How to Program, 9/e Presented by: Dr. José M. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Object-Oriented Programming: Inheritance Deitel &Deitel Java SE 8.
You gotta be cool. Inheritance Base Classes and Derived Classes Inheritance: Public, Protected, Private What is inherited from the base class? Multiple.
By: Raymond Hummon. Polygon What is a Polygon? A Polygon is a closed plane figure bounded by three or more line segments.
CSCI 143 OOP – Inheritance 1. What is Inheritance? A form of software reuse Create a new class from an existing class – Absorb existing class data and.
CS 106 Introduction to Computer Science I 11 / 19 / 2007 Instructor: Michael Eckmann.
Computer Science I Inheritance Professor Evan Korth New York University.
Rotational Symmetry All 2 dimensional shapes have some rotational symmetry. The degree of rotational symmetry that an object has is known as its order.
MEAP REVIEW. A polygon is a closed figure whose sides are made up of straight line segments that do not cross.
2 dimensional shapes and other geometry terms
Introduction There are many kinds of quadrilaterals. Some quadrilaterals are parallelograms; some are not. For example, trapezoids and kites are special.
Let’s review our lessons so far! Julie Dill. What is a polygon? 1.An open figure with straight sides. 2.A closed figure with at least one curved side.
The Quads Copy down all of the notes in RED.. A trapezoid has 4 sides and exactly 1 pair of parallel sides.
Geometry Quadrilaterals. Geometry: Plane Shapes quadrilateral: any closed, four-sided shape.
CS 100Lecture 241 CS100J Lecture 24 n Previous Lecture –MatLab demonstration n This Lecture –Inheritance –Method overriding –Polymorphism –Reading: n Lewis.
Solids, Shapes, Lines, and Angles Linda Hyde Kentwood Elementary
8.6 – Identify Special Quadrilaterals
Geometry The shape of things to come….
Quadrilateral Classification Tree.
2D Shapes How many different triangles can you make on the grid? Don’t include reflections / rotations of triangles already made How many different squares.
Sta’s Poniatowski, Carly Lear, and Jessica Faris.
APPLYING POLYGON PROPERTIES TO COORDINATE GEOMETRY 6.7 – 6.8.
7-6 Quadrilaterals Course 1 Warm Up Warm Up Lesson Presentation Lesson Presentation Problem of the Day Problem of the Day.
The mathematical study of the properties, measurements, and relationships of points, lines, planes, surfaces, angles, and solids. Geometry.
Area of Polygons. Remember your special right triangles.
Patterns and Transformations $10 $20 $30 $40 $50 $30 $20 $40 $50 $10 $40 $50 Combine Shapes Patterns Polygons Transformations Transformations are worth.
Warm-up Homework out on desks, ready to be checked Prepare a sheet for notes, with the heading: Triangles and Quadrilaterals VOICE LEVEL ZERO.
By. Circle Draw a circle in the box Tell about its attributes: sides, angles, whether or not it’s a polygon. Add any additional information you know about.
Polygons Polygons Simple, Simple, Closed figure Closed figure Made up of line segments Made up of line segments.
Geometry Grade 3 Jeopardy TrianglesPolygons Lines and Segments AnglesFigures
Polygons Lesson What is a polygon? A polygon is a simple, closed, two-dimensional figure formed by three or more line segments (sides). Closed?
Reflectional Symmetry The image is exactly the same on both sides… therefore it is reflected across the line of symmetry. WARM UP: Draw lines of Symmetry.
Seth Mohammed Nathan Matthews We are working on a slideshow. It’s about different types of shapes.
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt Angles Quadri- laterals Ratio and.
Next Rectangle-4 right angles Parallelogram - 4 parallel angles Square-4 right angles 4 congruent sides Trapezoid- one pair of parallel lines Rhombus-
POLYGONS & QUADRILATERALS
What 2D shape am I?.
The area of trapezoid 1cm Parallelogram 1㎠1㎠ 10cm 2 +2cm 2 =12cm 2 Let’s estimate.
Geometric Polygons 10 th Grade Geometry Laurie Grodziak Click Here Go to Main Screen.
Types of Triangles and Quadrilaterals “I can draw and label 2-D figures.”
Quadrilaterals.
Geometry. Line segment ray line Right angle Acute angle.
SHAPES AND PATTERNS GRADE 3.
Geometry Shapes A-Sauce STARS MATH 6/29/2010. Quadrilaterals Is a polygon that has four sides and all angles add up to 360 o.
Topics Inheritance introduction
Describe & Analyze Two-Dimensional Shapes
Geometry Polygons next © Math As A Second Language All Rights Reserved 2.G#1.
There are many kinds of shapes. Look around you, There are shapes in everything you see.
PLOYGONS!! By:edilberto zeferino!!. Right Triangle Equilateral Triangle.
9-3: Classifying Polygons Logic Activity. I am a trapezoid I have two angles that each measure 45˚ I have two other angles that each measure 135˚ #1)
GEOMETRY CHAPTER 6: QUADRILATERALS By Carl Green -_-
P RACTICE AND R EVIEW. 13 × (40 + 6) 87 − 9 5 × 9 40 × 10.
Properties of Quadrilaterals (4-sided figures) Learning Target: Students can use coordinates to prove simple geometric theorems algebraically.
7-7 Quadrilaterals Course 2 Warm Up Warm Up Problem of the Day Problem of the Day Lesson Presentation Lesson Presentation.
Chapter 1 Polygons. Bell Work What is a polygon? Give some examples.
6-7 Polygons in the Coordinate Plane. Classifying Quadrilaterals Given the coordinates of the vertices, how would you determine if the quadrilateral is…
J.Byrne Types of Triangles pg 1  The sum of the angles in any triangle is 180°  Equilateral Triangle  3 sides and 3 angles are equal  Isosceles.
7-7 Quadrilaterals Warm Up Problem of the Day Lesson Presentation
Graphing polygons on the coordinate plane.
The rectangle is split into 4 equal parts
CS100A Lecture 22 Previous Lecture This Lecture Inheritance
Road Map Inheritance Class hierarchy Overriding methods Constructors
Polygons TeacherTwins©2015.
2- and 3-Dimensional Figures
Exploring Polygons.
Classify Polygons Name: ____________________________________
Presentation transcript:

Inheritance Doing More with Your Classes

Review of Classes Collection of instance variables and instance methods Treated like a data type Encapsulation and Data Hiding

Inheritance: An Intuitive Example Think about this school community... Everyone is a CommunityMember This can be broken into groups These groups can be broken into other groups

CommunityMember Employee Student Alumnus FacultyStaff AdministratorTeacher UnderClassmanUpperClassman PrivilegesNoPrivileges This is kind of chart is called an “inheritance hierarchy” or “class hierarchy”

Here’s the important part: Each subgroup has all of the elements from the group above it Add special features to each subgroup that other groups don’t have –More on this in a bit...

A few more everyday examples Vehicles Bank Accounts Polygons

Vehicle Car Automobile Train Helicopter Truck Van Commuter Freight Military

BankAccount CD Savings Checking Retirement Basic MoneyMarket Business NoInterest Interest 401(k) Personal IRA

Polygons Right Triangle Quadrilateral Hexagon Isosceles Scalene Parallelogram Rhombus Rectangle Square Trapezoid RegHex Multiple Inheritance

Some Terminology “is-a” –Indicates that a class “is a” subclass of another class –Teacher “is a” Faculty –Square “is a” Rectangle “has-a” –Indicates that an object is an instance variable of another class –Student “has a” Grades

More Terminology Direct Inheritance –Object only 1 “level” below superclass –Triangle and Polygon (direct subclass) Indirect Inheritance –Object connected to a superclass through one or more other subclasses –Rectangle and Polygon

Let's look back at our School Community example again

CommunityMember Employee Student Alumnus FacultyStaff AdministratorTeacher UnderClassmanUpperClassman PrivilegesNoPrivileges

All CommunityMembers have a first and last name All Employees are CommunityMembers, so they have first and last names –they also have an employee ID number and years of service All Faculty are Employees, so they are also CommunityMembers, and have all 4 previous parts –they also have a salary All Teachers are Faculty, so they are also Employees and CommunityMembers, so they have all 5 previous parts –they also have a class schedule, education level, and type of certificate

CommunityMember –firstName –lastName Employee –firstName –LastName –employeeID –yearsOfService Faculty –firstName –lastName –employeeID –yearsOfService –salary Teacher –firstName –lastName –employeeID –yearsOfService –salary –classSchedule –educationLevel –typeOfCertificate

Looking Ahead Tomorrow we will look at how this translates to code and objects Use our “School Community” hierarchy Packets with examples coming tomorrow –Don't lose them! –Make personal notes on them –Study them