In this lesson, students are introduced to classes and objects. These are the foundations of object oriented programming.
Students will learn about objects that have state and behavior, and classes which are the templates for creating objects. This lesson corresponds with AP Computer Science A topic 2.1.
Students will be able to:
In this lesson, students will create and use constructors. The constructor, or signature of a class, allows for the creation of a new object. Students will create objects by calling constructors with parameters. Parameters are values that are passed into a constructor. These are referred to as actual parameters. This lesson corresponds with AP Computer Science A topic 2.2.
Students will be able to:
In this lesson, students are introduced to method overloading. This is when several different methods are written, each with the same name. As long as each method’s parameter list is different, the same method name can be used multiple times! This lesson corresponds with AP Computer Science A topic 2.2.
Students will be able to:
In this lesson, students will take a deeper look into creating and calling the methods of a class. Methods are procedures that define and allow for control of the behavior of an object. Once an object is instantiated, the instance variables can be used across the different methods that are created. Students will also learn about procedural abstraction for methods that can be used without knowing all of the underlying details and code. This lesson corresponds with AP Computer Science A topic 2.3.
Students will be able to:
In this lesson, students will build on what they have learned and discover how to call a void method with parameters. Just as constructors can have parameter values, methods can have formal parameters that affect the state of the object as well. Methods can also be overloaded just like constructors! This lesson corresponds with AP Computer Science A topic 2.4.
Students will be able to:
In this lesson, students will learn how to call a non-void method and return a value from a method by using the keyword return. The return keyword returns a variable or value back to the existing program so it can be used further along in the program. This lesson corresponds with AP Computer Science A topic 2.5.
Students will be able to:
In this lesson, students will learn about the immutability of Strings as objects. Once a String object is created, it cannot be changed or manipulated. The only way to change a String value is to reassign the variable with a different String value. Students will also practice String concatenation using operators such as +
and +=
and use escape sequences such as \”
and \n
. This lesson corresponds with AP Computer Science A topic 2.6.
Students will be able to:
In this lesson, students will look at Strings as a sequence of characters and utilize String methods from the java.lang package. Students will learn about packages, libraries and documentation. The following String methods will be examined in this lesson:
name.length()
name.substring(2, 6)
name.indexOf(“d”)
name.equals(“Karel”)
name.compareTo(“Karel”)
This lesson corresponds with AP Computer Science A topic 2.7.
Students will be able to:
This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…
In this lesson, students will learn how to convert primitive types to object types using a wrapper class. They will learn how Java automatically converts types using autoboxing and unboxing. This lesson corresponds with AP Computer Science A topic 2.8.
Students will be able to:
In this lesson, students will learn about static methods. Static methods are methods that can be called without creating an object. More specifically, students will discover and practice using static methods in the Java Math class. The following Math class methods will be examined in this lesson:
Math.abs(x)
Math.pow(base, exponent)
Math.sqrt(x)
Math.random()
Math.round()
Math.cos()
Math.sin()
Math.PI
This lesson corresponds with AP Computer Science A topic 2.9.
Students will be able to: