Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Lesson 5.6 Writing Methods

Description

In this lesson, students will examine writing classes in more detail. It is a good programming practice to avoid altering objects within methods unless the method specifically calls for alterations to the object. Accessor and getter methods make obvious changes to objects, but most methods should not attempt to make changes unless it’s explicitly necessary. This lesson corresponds with AP Computer Science A topic 5.6.


Objective

Students will be able to:

  • Discuss changes to both primitive and reference formal parameters in methods