WC - Writing Classes Overview
Writing Classes
Introduction
Key Terms
accessor method - A method that accesses an object but does not change it.
API documentation - Information about each class in the Java library.
mutator method - A method that changes the state of an object.
object reference - A value that denotes the location of an object in memory.
parameters - An item of information that is specified to a method when the method is called.
Module Lessons Preview
In this module, we will study the following topics:
Anatomy of a Class: The class is the blueprint for all objects that it creates. There are certain things that every class needs. In this lesson we will learn the content and best order for writing everything that is included in a class diagram.
Constructors: Once the instance variables have been declared they need to be initialized. This lesson will show how constructors can initialize variables to default values or values passes from different programs.
Accessor & Mutators Method: Since instance variables are private, we must have a way to access them outside the class. This lesson will show you how to write accessor and mutator methods and the toString method.
Writing Methods: Methods are where the most interesting code of programs takes place. This is where all the logic and expressions can be put to good use. This lesson will review how to read and write methods. It is also where we will start to look at free response questions for the AP Exam.
Scope and Access: What do variables and boats have in common? Check out this lesson to learn how far a variable can travel and what to do when we have multiple variables with the same name. Ethical and social implications of computing systems is also explored in this lesson.
IMAGES CREATED BY GAVS