APCSA Unit 1 Test Review (1.7-1.15)

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

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

37 Terms

1
New cards

class

defines a new data type. It is the formal implementation, or blueprint, of the attributes and behaviors of the objects of that class

2
New cards

object

a specific instance of a class with defined attributes. _____ are declared as variables of a class type

3
New cards

constructors

code that is used to create new objects and initialize the object’s attributes

4
New cards

new

keyword used to create objects with a call to one of the class’s constructors

5
New cards

instance variables

define attributes for objects; typically private

6
New cards

(instance) methods

define the behaviors or functions for objects

7
New cards

static methods

methods that belong to the class itself rather than to any specific instance/object of the class

8
New cards

dot (.) operator

used to access an object’s methods

9
New cards

parameters (arguments)

the values or data passed to an object’s method inside the parentheses in the method call to help the method do its job

10
New cards

return values

values returned by methods to do the calling method

11
New cards

immutable

String methods do not change the String object. Any method that seems to change a string actually creates a new string

12
New cards

new

is used to create a new object

13
New cards

null

is used to indicate that an object reference doesn’t refer to any object yet

14
New cards

String(String str)

Constructs a new String object that represents the same sequences of characters as str

15
New cards

int length()

returns the number of characters in a String object

16
New cards

String substring(int from, int to)

returns the substring beginning at index from and ending at index (to-1). The single element substring at position index can be created by calling substring(index, index+1)

17
New cards

String substring(int from)

returns substring(from, length())

18
New cards

int indexOf(String str)

returns the index of the first occurrence of str; returns -1 if not found

19
New cards

boolean equals(Object other)

returns true if this (the calling object) is equal to other; returns false otherwise

20
New cards

int compareTo(String other)

returns a value < 0 if this is less than other; returns zero if this is equal to other; returns a value > 0 if this is greater than other.

21
New cards

Integer(value)

Constructs a new integer object that represents a specified int value

22
New cards

Integer.MIN_VALUE

The minimum value represented by an int or integer

23
New cards

Integer.MAX_VALUE

The maximum value represented by an int or integer

24
New cards

Int IntValue()

Returns the value of this Integer as an int

25
New cards

Double(double value)

Constructs a new Double object and represents that specified double value

26
New cards

double doubleValue()

Returns the value of this Double as a double

27
New cards

int abs(int)

Returns the absolute value of an int value (which means no negatives)

28
New cards

double abs(double)

returns the absolute value of a double value

29
New cards

double pow(double,double)

Returns the value of the first parameter raised to the power of the second parameterd

30
New cards

double sqrt(double)

Returns the positive square root of a double value

31
New cards

double random()

Returns a double value greater than or equal to 0.0 and less than 1.0 (not including 1.0)

32
New cards

(int)(Math.random()*range) + min

moves the random number into a range starting from a minimum number. The range is the (max number - min number + 1)

Example: to get a number in the range of 5 to 10, use the range 10-5 + 1 = 6 and the min number 5: (int)(Math.random()&6) + 5)

33
New cards

object

a specific instance of a class with defined attributes

34
New cards

class

defines a new data type with instance variables and methods

35
New cards

methods

define the behaviors or functions for objects

36
New cards

constructors

code that is used to create new objects and intialize the object’s attributes

37
New cards

parameters

the values or data passed to an object’s method