AP CSA Unit 2 Using Objects

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

1/53

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.

54 Terms

1
New cards

Object

a variable of a data type that is user defined

2
New cards

State

data/attributes about that object

3
New cards

behavior

actions that can be performed on the object

4
New cards

class

template for creating an object

5
New cards

object oriented programming

using object type variables in programming

6
New cards

instance variable

Used to store the state, or data of the object instances.

7
New cards

Constructor

signature of a class that allows for the creation of a new object

8
New cards

constructor name

used to create a new object; must match the name of the class and be in lowerCamelCase

9
New cards

instantiate

Create an instance of a class object

10
New cards

parameter list

variables containing values passed to the constructor

11
New cards

new operator

instantiates a new class object

12
New cards

overloading

The process of using the same operator symbol or identifier to refer to many different functions.

13
New cards

formal parameter

parameters that are outlined in the parameter list in the constructor

14
New cards

actual parameter

parameters that are input when a new instance of a class object is created

15
New cards

client

when we use a class that someone else has created, we become a

16
New cards

methods

procedures that allow us to control and define the behavior of an object

17
New cards

null

a keyword that indicates a reference object doesn’t point to any object data

18
New cards

void

indicates that the method doesn't return anything

19
New cards

procedural abstraction

being able to use code that we don't fully understand

20
New cards

return type

determines the type that will be return from a method

21
New cards

access specifier

determines who has access to using the method when writing classes and objects

22
New cards

objectName.method()

Calling a method

23
New cards

return keyword

used to return a value back to the main program from a method

24
New cards

scope

defines which part of the program a variable can be accessed from

25
New cards

Immutable

Unable to be changed or manipulated. Strings are immutable.

26
New cards

Concatenation

The process of adding two String values together. This creates a new String object. Primitives can be concatenated with String objects

27
New cards

Implicit Conversion

The automatic process of transforming a variables data type. This occurs when a primitive and String object are concatenated by changing the primitive value to a String object type.

28
New cards

Escape sequences

Enable users to use special characters and actions within String objects

29
New cards

name.concat(“value”)

returns a new String with “value” appended to the end of name

30
New cards

name.replace(“a”, ”p”)

returns a new String with all instances of “a” in name replaced with “p”

31
New cards

name.toUpperCase()

returns name as Upper Case Letters

32
New cards

\”

Allows for quotations

33
New cards

\\

includes a backlash

34
New cards

\n

creates a line break

35
New cards

\t

adds a tab space

36
New cards

String(String str) constructor

constructs a new String object that represents the same sequence of characters as str

37
New cards

name.length()

returns the number of characters in a String object

38
New cards

name.substring(2, 6)

returns the substring beginning index 2 and ending at index 5

39
New cards

IndexOutOfBoundsException

A String object has index values from 0 to length - 1. Attempting to access indices outside this range will result in this error

40
New cards

name.indexOf(“d”)

Returns the index of the first occurence of d; returns -1 if not found

41
New cards

name.equals(“Karel”)

Returns true if name is equal to Karel; returns false otherwise

42
New cards

name.compareTo(”Karel”)

Returns a value < 0 if name is less than Karel; returns zero if name is equal to Karel; returns a value > 0 if name is greater than Karel

43
New cards

Application Programming Interfaces

APIs and libraries simplify complex programming tasks by providing sets of clearly defined methods of communication among various computing components.

44
New cards

Documentation

reference for how to use different methods and classes

45
New cards

Wrapper classes

class which contains or “wraps” primitive data types as an object

46
New cards

Integer.intValue()

converts Integer value into an int value

47
New cards

Double.doubleValue()

converts Double value into an int value

48
New cards

Autoboxing

converting a primitive value into an object of the corresponding wrapper class

49
New cards

unboxing

converting an object of a wrapper type to its corresponding primitive value

50
New cards

static methods

methods in Java that can be called without creating an object of a class

51
New cards

Math.abs(x)

returns the absolute value of x

52
New cards

Math.pow(base, exponent)

returns the value of base raised to the power of exponent

53
New cards

Math.sqrt(x)

returns the positive square root of x

54
New cards

Math.random()

returns a double value greater than or equal to 0.0 and less than 1.0