Skip to content
Marlbridge

AP® Computer Science A · Unit 3 · Topic 3.3

Anatomy of a Class: Topic Checklist (Computer Science A 3.3)

Specific I can statements for the anatomy of a Java class: access modifiers, instance variables, constructors, methods and encapsulation, each linked to guide and practice.

Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions; see also the revision notes.

Understanding

  • I can name the four parts of a class: header, instance variables, constructors and methods. (Guide: “The anatomy in code”; Practice Question 1)
  • I can explain what public and private each allow. (Guide: “Access: public and private”; Practice Questions 2 and 6)
  • I can explain encapsulation in terms of private data and public methods. (Guide: “Access: public and private”; Practice Question 9)
  • I can explain that each object has its own copy of each instance variable. (Guide: Worked example 1; Practice Question 4)

Skills

  • I can declare a class, its private instance variables, public constructor and public methods in the correct form. (Guide: Worked example 2; Practice Question 7)
  • I can write a private helper method and call it from a public method. (Guide: Worked example 2; Practice Questions 5 and 6)
  • I can trace the state of two objects of one class through a sequence of calls. (Guide: Worked example 1; Practice Questions 4 and 5)
  • I can spot and fix an access error or a constructor written with a return type. (Guide: “What the compiler enforces”; Practice Questions 3 and 8)

Reasoning

  • I can explain why a private instance variable is changed through a public method instead of directly. (Practice Question 9)
  • I can decide whether a method should be public or private from how it will be used. (Guide: “Access: public and private”; Practice Question 6)
  • I can explain why void in front of a constructor name changes what the code means. (Guide: “Common misconceptions”; Practice Question 8)

All ticked? Move on to the Topic 3.4 study guide, Constructors, or return to the course roadmap.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.