AP CSA Unit 2: Using Objects

0.0(0)
studied byStudied by 8 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

33 Terms

1
New cards

Abs(int a)

used to find and return absolute values of an int

2
New cards

Assignment Operator

to assign a value to a variable (“=”)

3
New cards

Class

user-defined data types in object oriented programming

serves as a blueprints for creating objects by defining their attributes/instance variables

4
New cards

Constructor

a special method/procedure within a class that is used to create an instance of a class, always has same name of the class

to create an object/instance of a class by initializing the instance variables

ex. Object obj = new Object();

5
New cards

Encapsulation

the bundling of data and methods within a class, where the data is hidden from external access

ensures that an objects internal state remains consistent by controlling how it can be accessed or modified

6
New cards

IllegalArgumentException

an exception that occurs when a method receives an argument that is inappropriate or invalid for its intended purpose

indicates that there was an error in how arguments were passed into a method

7
New cards

IndexOf(String str)

used to find the index position of the first occurrence of a specified substring within a larger string

8
New cards

Inheritance

a concept in object-oriented programming where a class inherits the properties and behaviors of another class

allows for code reuse and promotes the creation of hierarchical relationships between classes

9
New cards

Return type (void)

return type in programming refers to the data type of the value that a method or function returns

in the case of “void,” it means that the method does not return any value

10
New cards

Length()

used to find the number of characters in a string

11
New cards

Math class

provides various mathematical operations and functions that can be performed on numeric data types

(includes methods for basic arithmetic operations, trigonometry, logarithms, random numbers generation, etc)

12
New cards

Methods

set of instructions for all object of a class

can manipulate data, interact with other objects, or return values

ex: simplify();

13
New cards

Null

a special value in programming that represents the absence of a value

means the object is referring to nothing

14
New cards

Object-oriented programming (OOP)

a programming paradigm that organizes code into objects, which are instances of classes

emphasizes the use of objects to represent real-world entities and their interactions

15
New cards

Objects

instance of a class that represent real-world entities or concepts

describes behavior/methods into a single entity

16
New cards

Overloading constructors

refers to the ability to have multiple constructors in a class, each with a different set of parameters (allows objects to be created with different initial states or configurations)

17
New cards

Parameters

variables declared in a method or function that receive values when the method is called, allow data to be passed into a method and enabled it to perform actions or calculations based on those values

18
New cards

Polymorphism

the ability of objects to take on multiple forms or have multiple types

allows different objects to be treated as instances of a common superclass, enabling flexibility and extensibility

19
New cards

Pow(double a, double b)

used to raise a number (a) to the power of another number (b)

20
New cards

Primitive data types

basic data types that are built into a programming language and represent simple values (include: double, int, boolean)

21
New cards

Random()

generates and returns a pseudorandom decimal value between 0.0-0.99

22
New cards

Reference types

data types in programming that store references or memory addresses rather than the actual value themselves (include objects, arrays, and strings)

23
New cards

Sqrt(double a)

calculates and returns the square root of a given number (a)

24
New cards

Substring(int beginIndex, int endIndex)

used to extract a portion of a string based on the specified beginning and ending indexes

returns a new string that contains the characters from the original string within the given range

25
New cards

Substring(in beginIndex)

used to extract part of an existing string starting from the specified beginning index up to the end of the original string

26
New cards

method call

calls/invokes the method code

27
New cards

String

object that holds sequences of characters (“a”, “b”, “$”)

28
New cards

String literal

set of characters enclosed in double quotes

ex: :”Kelly”

29
New cards

Reference variable

when an object points to a space in memory

30
New cards

Concatenation

operation of joining 2 strings together

ex: “Hello“ + “World” = “HelloWorld

31
New cards

\”

to add quotation marks in string

32
New cards

\\

to add backslash in string

33
New cards

\n

to add new line inside string