Please enable JavaScript to use CodeHS

Chapter 2

Using Objects

2.1 Objects: Instances of Classes Overview Objects Classes Classes vs Objects Rectangle Skeleton GrilledCheese Skeleton Shark Skeleton Check Your Understanding Exercise: Ice Cream Instance Variables
2.2 Creating and Storing Objects (Instantiation) Parts of a Class Method Signatures and Parameters Creating New Objects Constructor Overload Using Existing Objects The Rectangle Class The Point Class The Student Class Check Your Understanding Exercise: Instance Variables for Your Cat
2.3 Calling a Void Method Overview Method Signature Using Methods Calling Methods User Input and the Scanner Class Area of a Rectangle Program Flow Using the Scanner Class Increase/Decrease by 1 Int Before String Check Your Understanding Exercise: Birthday Budget
2.4 Calling a Void Method with Parameters Parameters Defining a Method with Parameters Calling a Method with Parameters Pass By Value Multiple Parameters Why Use Parameters? Parameter Order Calculator Method Overload Moving a Point Rectangle Check Your Understanding Exercise: More Operations
2.5 Calling a Non-void Method Returning Results Calling a Method With a Return Value Multiple Parameters With a Return Value Rectangle Desks in a Room Activity Log Check Your Understanding Exercise: Laundry Costs
2.6 String Objects: Concatenation, Literals & More Introducing Strings Concatenating Strings Concatenating Strings with Primitive Data Types Escape Sequences Immutable Strings String Concatenation Rectangle Dimensions Printing Equations Check Your Understanding Exercise: Quote Machine
2.7 String Methods APIs, Libraries, and Documentation Concatenating Strings with Reference Data Types Object Concatenation String Index Values Other Useful String Methods Bigger Strings? Chopping Strings Check Your Understanding Exercise: toString for Plants
2.8 Wrapper Classes: Integers and Doubles Wrapper Classes Creating Integer and Double Objects Autoboxing and Unboxing Autoboxing Example Methods in the Integer and Double Class Method Examples Creating Integers Using Doubles Check Your Understanding Exercise: Guess the number!
2.9 Using the Math Class Basic Math Operations Using the Math Class Random Numbers Generating Random Numbers Static Methods: Rectangle Check Your Understanding Exercise: Circle Area