Copyright by Scott GrissomCh 1 Objects and Classes Slide 1 Classes and Objects A Class refers to something in general describes a category of items a cookie.

Slides:



Advertisements
Similar presentations
Chapter 1 - Getting to know Greenfoot Acknowledgement: Michael Kolling & Bruce Chittenden.
Advertisements

Copyright by Scott GrissomCh 5 Sophisticated Behavior Slide 1 Java Class Library a very large collection of classes for you to use as needed the challenge.
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
CPSC150 Inheritance Details Chapter 9. CPSC150 Print in Entertainment ver 2 (with inheritance): public void print() { System.out.print("title: " + title.
Objects First with Java A Practical Introduction using BlueJ
Scott Grissom, copyright 2004Ch 3: Java Features Slide 1 Why Java? It is object-oriented provides many ready to use classes platform independent modern.
J. Michael Moore Object Oriented Programming: An Introduction CSCE 110.
Introduction to Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
1 Chapter 8 Objects and Classes. 2 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections,
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
9-Aug-15 Vocabulary. Programming Vocabulary Watch closely, you might even want to take some notes. There’s a short quiz at the end of this presentation!
1 CSC 221: Computer Programming I Fall 2004 Objects and classes: a first pass  software objects, classes, object-oriented design  BlueJ IDE, compilation.
CSC 212 – Data Structures Lecture 3: Fields, Methods, & Constructors.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Introduction to Object-Oriented Programming
Object Oriented Design: Identifying Objects
1 CSC 221: Computer Programming I Spring 2010 Objects and classes: a broad view  Scratch programming review  object-oriented design, software objects.
Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.
Introduction to Java and Object-Oriented Programming AJSS Computer Camp Department of Information Systems and Computer Science Ateneo de Manila University.
Introduction to Object Oriented Design Version 1.1.
OBJECTS AND CLASSES CITS1001. Concepts for this lecture class; object; instance method; parameter; signature data type multiple instances; state method.
1 COS 260 DAY 2 Tony Gauvin. 2 Agenda Questions? Class roll call Blackboard Web Resources Objects and classes 1 st Mini quiz on chap1 terms and concepts.
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Lecture Set 11 Creating and Using Classes Part B – Class Features – Constructors, Methods, Fields, Properties, Shared Data.
Chapter 1 Object Orientation: Objects and Classes.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Classes 1 COMPSCI 105 S Principles of Computer Science.
Object-Oriented Programming. An object is anything that can be represented by data in a computer’s memory and manipulated by a computer program.
1 CSC 221: Computer Programming I Spring 2008 Objects and classes: a broad view  software objects, classes, object-oriented design  BlueJ IDE, compilation.
Object-Oriented Programming •Object-Oriented Programming (OOP) allows you to create your program based upon modeling objects.  Your program’s properties.
CMSC 150 CLASSES CS 150: Mon 6 Feb 2012 Images: Library of Congress.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Lec 14 Writing an Instantiable Class III. Agenda Review of Instantiable Classes Scope of variables Using this to override scope issues Lab: Creating a.
Copyright by Scott GrissomCh 2 Class Definition Slide 1 Class Structure public class BankAccount{ fields constructor(s) methods } Sample Code Ticket Machine.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
1 CSC 221: Computer Programming I Fall 2009 Objects and classes: a broad view  Scratch programming review  object-oriented design, software objects 
Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
Lecture 3: More on Classes Textbook: Chapter 2 Recap: –Classes vs. Objects –Q: What comes first a class or an object? –Q: Do we need a class to create.
Classes and Objects. Primitives Single-valued data items. Not Objects byte8-bit signed two's complement integer short16-bit signed two's complement integer.
 An object is basically anything in the world that can be created and manipulated by a program.  Examples: dog, school, person, password, bank account,
COMP Information Hiding and Encapsulation Yi Hong June 03, 2015.
Designing Classes Lab. The object that you brought to class Put it in the basket we will exchange them now.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Chapter 1 Object Orientation: Objects and Classes.
Week 21 Introduction to Programming Ms. Knudtzon C Period Lecture 3.
Defining Classes and Methods
Objects as a programming concept
Objects and Classes CITS1001 week 1.
Objects First with Java A Practical Introduction using BlueJ
Object-Orientated Design: Part 2
Objects as a programming concept
Object Oriented Programming in JavaScript
OBJECT ORIENTED CONCEPTS
Objects First with Java A Practical Introduction using BlueJ
Object-Oriented Programming
COS 260 DAY 2 Tony Gauvin.
Object-Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
Object-Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
Defining Classes and Methods
Classes CS 21a: Introduction to Computing I
Introduction to Object-Oriented Programming
Defining Classes and Methods
CS 200 More Classes Jim Williams, PhD.
From Class Diagram to Contract Diagram
Presentation transcript:

copyright by Scott GrissomCh 1 Objects and Classes Slide 1 Classes and Objects A Class refers to something in general describes a category of items a cookie cutter to create items a blueprint to build an item An Object a specific item that has unique properties (characteristics) also called an instance of a class objects are instantiated from classes objects have state and behavior Examples All cars have a color, MPG, and location My car is gray an in parking lot C All people have a height, weight and name Joe is 5’-10 and weights 150 lbs Wonder Woman is a super hero Lassie is a dog Atlas Shrugged is a book

copyright by Scott GrissomCh 1 Objects and Classes Slide 2 BlueJ Demo #1 open the Shapes project instantiate an object invoke a method provide parameters inspect an object’s state

copyright by Scott GrissomCh 1 Objects and Classes Slide 3 Methods Methods tell an object to do something “raise your hand” “stand up” start engine Some methods require parameters “step forward” - how many steps? “clap hands” - how many times? turn - which direction? Some methods return an answer “what is your name?” what is the square root of 16? return an answer how much gas is in the tank?

copyright by Scott GrissomCh 1 Objects and Classes Slide 4 Dog what are characteristics? breed hair color name weight gender what is some appropriate behavior? roll over play dead sit fetch speak

copyright by Scott GrissomCh 1 Objects and Classes Slide 5 Car what are characteristics make model color year engine what is a typical behavior start engine brake accelerate turn

copyright by Scott GrissomCh 1 Objects and Classes Slide 6 Important Concepts Data types int String boolean State - current values of all attributes Source code - text description of a class including its data fields and methods class is equivalent to a chapter methods are equivalent to paragraphs source code must compile without syntax errors Summary objects are instantiated from classes objects have state and behavior objects have methods that are invoked

copyright by Scott GrissomCh 1 Objects and Classes Slide 7 BlueJ Demo #2 open Lab-classes project create a student(s) invoke getName( ) create a LabClass enroll a student

copyright by Scott GrissomCh 1 Objects and Classes Slide 8 BlueJ Demo #3 open Picture project build a sunset method build a sunrise method