Loading video...
Classes & Objects
- A Java program consists of classes
- A constructor creates a new object of a class
- A method is a function defined within a class
- A class can also contain data fields
- The return type is the type of value that a method returns to the caller
- Public: everyone outside the class can get at the method or data
- Private: only members of the class can get at the method or data
- Instance: each object of the class gets its own copy of the method or data
- Static: the method or data is shared by the class instead of multiple copies
- Overloaded methods are two or more methods with the same name but different signatures
Classes & Objects
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
- Intro
- Roadmap
- Classes and Objects
- Constructors
- Constructors
- Methods
- Methods
- Data Fields
- Data Fields
- Return Type
- Return Type
- Access Control
- Access Control
- Definition of Public
- Definition of Protected
- Definition of Private
- Guidelines on What to Make Public/ Private
- Accessors and Modifiers
- Static vs. Instance
- Example: Static vs. Instance
- Passing Data to Method
- Getting Data Back From Methods
- Overloaded Methods
- Example: Overloaded Methods
- Overloaded Methods
- Summary

































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview