Transcript
Page 1: 1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a

1

Chapter 3 and 6– Classes, Objects and Methods

Object-Oriented Programming Concepts – Read it from Java Tutorial

Definition: A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind.

Page 2: 1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a

2

Chapter 3 and 6– Classes, Objects and Methods

Page 3: 1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a

3

Chapter 3 and 6– Classes, Objects and Methods

How Do These Concepts Translate into Code?

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

Objectives

1.What classes, objects, methods and instance variables are. 2.How to declare a class and use it to create an object. 3.How to declare methods in a class to implement the class's behaviors. 4.How to declare instance variables in a class to implement the class's attributes. 5.How to call an object's method to make that method perform its task. 6.The differences between instance variables of a class and local variables of a method. 7.How to use a constructor to ensure that an object's data is initialized when the object is created. 8.The differences between primitive and reference types.

Page 4: 1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a

4

Chapter 3 and 6– Classes, Objects and Methods

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors

3.3  Declaring a Class with a Method and Instantiating an Object of a Class

3.4  Declaring a Method with a Parameter

3.5  Instance Variables, set Methods and get Methods

3.6   Primitive Types vs. Reference Types

3.7  Initializing Objects with Constructors


Recommended