Please enable JavaScript to use CodeHS

Introduction to Java (Latte)

Classes and Object-Oriented Programming

This module teaches students the basics of Object Oriented Programming in Java, which is a powerful programming paradigm. Students will learn how objects store data and interact with each other in Java programs. Students will design and implement classes and extend classes using inheritance.

Lessons

4.1 Introduction to Classes and Objects

  • What is a Class?
  • Quiz: Classes and Objects
  • The Rectangle Class
  • The Point Class
  • The Student Class
  • +4 more

4.2 Classes vs. Objects

  • Classes and Objects
  • Classes vs. Objects vs. Instances
  • Classes, Objects, and Instances
  • Creating Rectangle Objects
  • Text Messages

4.3 Using a Class as a Client

  • How to Use a Class
  • Quiz: Client of a Class
  • Using the Rectangle Class as a Client
  • Using the Randomizer Class as a Client
  • Coin Flips
  • +3 more

4.4 Writing Classes

  • Constructors
  • Quiz: Constructors
  • Student Constructor
  • Rectangle Constructor
  • Triangle Class: Constructor
  • +8 more

4.5 Writing Classes and Instance Methods

  • Writing Instance Methods
  • Quiz: Writing Methods
  • Area of a Rectangle
  • Moving a Point
  • Writing getPerimeter()
  • +4 more

4.6 Getter and Setter Methods

  • Getter and Setter Methods
  • Quiz: Getter and Setter Methods
  • Rectangle Getter Methods
  • Student Getter Methods
  • Text Messages Getter Methods
  • +2 more

4.7 Class Methods and Class Variables

  • Static Methods and Variables (Class Methods and Class Variables)
  • Quiz: Static Methods
  • Student Class Variables and Methods
  • Using the Math Class
  • Using Randomizer
  • +6 more

4.8 Method Overloading

  • Method Overloading
  • Method Overloading Quiz
  • Sum Method Overloading
  • Constructor Overloading
  • Product Method Overloading

4.9 Local Variables and Scope

  • Local Variables and Scope
  • Local Variables and Scope Quiz
  • Instance Variable Scope
  • Local Variable Scope
  • Variable Shadowing
  • +1 more

4.10 Key Terms for Classes

  • Key Terms for Classes
  • Quiz: This Keyword
  • Rectangles and this
  • Batteries
  • Write Your Own CodeHS

4.11 Objects vs Primitives

  • Objects vs Primitives
  • Objects vs Primitives Quiz
  • Comparing Rectangles
  • Changing Dogs
  • Null Pointer Exception
  • +2 more

4.12 Inheritance

  • Inheritance
  • Quiz: Subclasses and Superclasses
  • Square is a Rectangle
  • Clothing Store

4.13 Class Design and Abstract Classes

  • Class Design and Abstract Classes
  • Quiz: Class Design
  • The Shape Hierarchy
  • Classes for Dessert
  • Finding The Perimeters

4.14 Polymorphism

  • Polymorphism
  • Quiz: Polymorphism
  • Animal Sounds
  • Shape Areas
  • Fun with Solids

4.15 Interfaces

  • Interfaces
  • Quiz: Interfaces
  • Comparable Interface
  • Summable Interface
  • Fraction is Comparable
  • +2 more

4.16 Unit Quiz

  • Classes and Object-Oriented Programming

Courses that include this module