Computer Science 2 Study Guide

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:15 PM on 9/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards

Private vs Public

Controls who can access something inside a class.


Private - only the class can directly access it and is used to protect data


Public - All other code can access it

2
New cards

Encapsulation

Putting data and the functions that control that data together inside a class, while hiding/protecting the data.

3
New cards

Getters

A getter gets/returns the value of a private variable

4
New cards

Setters

A setter changes the value of a private variable

5
New cards

Inspectors

An inspector is a function that looks at/gets information from an object without changing it

6
New cards

Mutators

A mutator is a function that changes the object’s data/state.

7
New cards

Constructors

A special function that runs automatically when an object is created.

8
New cards

Important constructor rules

A constructor:

  • Has the same name as the class

  • Has no return type

  • Runs automatically when an object is created


9
New cards

Facilitators

Facilitators generally mean functions that perform an operation or provide some service for the object, rather than simply getting or setting a value

10
New cards

Static

The static keyword means something belongs to the class itself rather to each individual object