CS106A, Stanford University

Slides:



Advertisements
Similar presentations
Written by: Dr. JJ Shepherd
Advertisements

Object Orientated Concepts. Overview  The world is objects  Defining an object  Not a function, it’s a method  Lets inherit want we can  Objects.
CSE 115 Week 10 March , Announcements March 21 – Lab 7 Q & A in lecture March 21 – Lab 7 Q & A in lecture March 26 – Exam 7 March 26 – Exam.
School of Computing Science CMT1000 © Ed Currie Middlesex University Lecture 9: 1 CMT1000: Introduction to Programming Ed Currie Lecture 11: Objects.
Objects First with Java A Practical Introduction using BlueJ
Class template Describing a generic class Instantiating classes that are type- specific version of this generic class Also are called parameterized types.
OOP Project Develop an Application which incorporates the following OO Mechanisms and Principals: – Classes Visibility Constructor(s) Class Variable (if.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
UML Class Diagram: class Rectangle
Fall 2005CSE 115/503 Introduction to Computer Science I1 Composition details Recall, composition involves 3 things: –Declaration of instance variable of.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Designing Classes Prelude © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
Written by: Dr. JJ Shepherd
Interfaces Describe what classes should do, without specifying how they should do it Not a class, but a set of requirements for classes that want to conform.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
1 Objects and Classes: creating simulations Powerpoint created by Beverly McGuire.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Classes and Objects C++ Programming Technologies.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Written by: Dr. JJ Shepherd
Web Design & Development Lecture 9
Objects First with Java A Practical Introduction using BlueJ
Java Events. Java Events Important definitions Overridden method Class vs. abstract class vs. interface Event Handling Definition Main components Windows.
Classes & Objects There are two main programming paradigms: Procedural Object-Oriented Up to now, everything we have done has been procedural.
Agenda Warmup AP Exam Review: Litvin A2
Direct Variation.
CS106A, Stanford University
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Section 11.1 Class Variables and Methods
Anatomy of a Class & Method
Packages, Interfaces & Exception Handling
CS106A, Stanford University
Strategy Design Pattern
UML Class Diagram: class Rectangle
Templates.
Using local variable without initialization is an error.
Object-Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
CS 106A, Lecture 22 More Classes
CS106A, Stanford University
Object-Oriented Programming
Interface.
Interfaces.
Lesson Objectives Aims Key Words:
Advanced Java Programming
CSE 1030: Implementing GUI Mark Shtern.
CS106A, Stanford University
Classes & Objects – Revisited…
Abstract Classes Page
CS106A, Stanford University
CS106A, Stanford University
Objects First with Java A Practical Introduction using BlueJ
CS106A, Stanford University
STORE MANAGER RESPONSIBILITIES.
Objects First with Java A Practical Introduction using BlueJ
CS106A, Stanford University
Review of Previous Lesson
Entry Guideline Template
Classes and Objects CGS3416 Spring 2019.
For More Details:
Presentation transcript:

CS106A, Stanford University Practical Classes Chris Piech CS106A, Stanford University

Be able to create a variable type from scratch Learning Goals Be able to create a variable type from scratch

A class defines a new variable type

You must define three things 1. What variables does each instance store? 2. What methods can you call on an instance? 3. What happens when you make a new one? *details on how to define these three things coming soon

Classes are like blueprints class: A template for a new type of variable.

What does a class do?

A class defines a new variable type

https://www.youtube.com/watch?v=jbkSRLYSojo

extends Make a class inherit all the instance variables and methods of another class

public class Simulator extends GraphicsProgram { // class definition }

public class NameSurferGraph extends GCanvas { // class definition }

I promise that this class will define implements I promise that this class will define a few given methods

public class NameSurferGraph extends GCanvas, implements ComponentListener { // class definition }

implements Also a cheeky way to share constants between classes I promise that this class will define a few given methods