AP Comp Sci (Methods, classes, constructors, etc )

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/17

encourage image

There's no tags or description

Looks like no tags are added yet.

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

No analytics yet

Send a link to your students to track their progress

18 Terms

1
New cards

object

a specific instance of a class

2
New cards

overloaded method

a method with the same name (but different parameters) as another method

3
New cards

public

can be used outside of a class

4
New cards

method

what an object can do (or how it can behave)

5
New cards

field (instance variable)

properties of a class

6
New cards

private

can only be used inside of a class

7
New cards

constructor

creates a new object

8
New cards

Class(public or private)

public

9
New cards

field(public or private)

Private

10
New cards

constructor(public or private)

Public

11
New cards

Method(public or private)

Public

12
New cards

Requirements for a constructor?

- Same name as class

- no return type

- no parameters

- Each constructor of a class must have a different set of parameters

- A class can have 0, 1, or several constructors.

- creates the object and usually initializes its field values.

- if no constructor is defined, then a default constructor will be invoked which has no parameters and sets all fields to default values (0 or null).

- ex: Student()

13
New cards

Requirements for a method?

- return type required

- modifier(optional)

- has the word public or private, the return type, the method name, and a list of parameters.

- The keyword void in a method header means that the method doesn't return anything.

- ex: getAge() -- accessor

14
New cards

reserved words

- predefined identifiers that have a specific meaning in the language syntax

- ex: int, double, new

15
New cards

Void

Used before a method if the method returns no value. In other words, it simply prints or manipulates values, but it doesn't actually return a value of its own.

16
New cards

Object-oriented programming

In Object-oriented programming, or OOP, all computations are carried out with objects.

17
New cards

Procedural programming

a list of instructions which tells the computer what to do step-by-step. Procedural programming is based on procedures, often called routines or subroutines. A procedure contains a series of steps to be carried out.

18
New cards

Accessor

- An accessor is a special method that allows methods outside of a class to have access to the class's private fields.