CS Awesome - Unit 2 Vocabulary

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/36

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

37 Terms

1
New cards

class

defines a new data type (a classification). 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.

3
New cards

attributes

data the object knows about itself

4
New cards

instance variables

variables in a class that define the attributes for objects

5
New cards

methods

these define the behaviors or functions for objects to describe what objects can do

6
New cards

constructor

creates a new object and initializes its attributes (they have the same name as the class).

7
New cards

new

used to create a new object; every object is created uterm-3sing the keyword new followed by a call to one of the class's constructors that initializes the object's attributes

8
New cards

constructor signature or header

the constructor name followed by the parameter list

9
New cards

method signature or header

the method name followed by the parameter list

10
New cards

wrapper classes

classes that create objects from primitive types, for example the Integer class and Double class

11
New cards

null

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

12
New cards

Math method: int abs(int)

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

13
New cards

Math method: double abs(double)

Returns the absolute value of a double value.

14
New cards

Math method: double pow(double, double)

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

15
New cards

Math method: double sqrt(double)

Returns the positive square root of a double value.

16
New cards

Math.random()

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

17
New cards

parameter list

a list of the types and variable names for the arguments being passed to a method or constructor.

18
New cards

overloading

creating multiple methods or constructors with the same name but different number or types of parameters.

19
New cards

call by value

When you call a method or constructor and give it an argument, a copy of the argument's value is saved in the parameter variable.

20
New cards

NullPointerException

This is the error if you try to call an object method on an object variable whose value is null

21
New cards

non-static or object method

These methods must be called using an object name . method name.

22
New cards

static method

These methods belong to a class and can be called by using the class name instead of creating an object.

23
New cards

return value

The value returned from a method to the calling method

24
New cards

strings

objects of the String class that hold sequences of characters.

25
New cards

index

a number associated with a position in a string (or array)

26
New cards

immutable

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

27
New cards

substring

part of a string (the method will create a new string that contains a copy of part of the original string).

28
New cards

String method: int length()

returns the number of characters in a String object.

29
New cards

String substring(int from, int to)

returns the substring beginning at index from and ending at index (to - 1).

30
New cards

String substring(int from)

returns substring(from, length()).

31
New cards

int indexOf(String str)

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

32
New cards

boolean equals(String other)

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

33
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.

34
New cards

substring(index, index + 1)

returns a single character at position index

35
New cards

autoboxing

the automatic conversion of primitive types to their corresponding object wrapper classes, for example int to Integer.

36
New cards

unboxing

the automatic conversion of wrapper class to the primitive type, for example Integer to int.

37
New cards

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

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