AP Computer Science A · Lesson 3.3 · Unit 3 · CED topic 3.3

Anatomy of a class

Name:   Date:  

1 Why this lesson matters

Read the opening paragraph and the "Required content" box on the lesson page. In your own words, explain each objective below.

3.A. Develop code to designate access and visibility constraints to classes, data, constructors, and methods.

2 The parts of a class

Read this section. In your own words, summarize the main idea.

3 Encapsulation: public and private

Read this section. In your own words, summarize the main idea.

4 What the compiler says when you break the rule

Read this section. In your own words, summarize the main idea.

5 Worked example

Read the "Worked example" box. Then, without looking back, try writing your own answer below.

Decide which statements compile, from a class Main that is separate from BankAccount.

6 Exam focus: avoid this mistake

Read the "Exam focus" box, then restate it in your own words.

7 Sum it up

In two or three sentences, explain this lesson's main idea to someone who has not read it.