Unit 2 Vocabulary

studied byStudied by 4 people
0.0(0)
get a hint
hint

defines a new data type (a classification). It is the formal implementation, or blueprint, of the attributes and behav­iors of the objects of that class.

1 / 36

37 Terms

1

defines a new data type (a classification). It is the formal implementation, or blueprint, of the attributes and behav­iors of the objects of that class.

class

New cards
2

a specific instance of a class with defined attributes.

object

New cards
3

data the object knows about itself

attributes

New cards
4

variables in a class that define the attributes for objects

instance variables

New cards
5

these define the behaviors or functions for objects to de­scribe what objects can do

methods

New cards
6

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

constructor

New cards
7

used to create a new object; every object is created using this keyword followed by a call to one of the class's constructors that initializes the object's attrib­utes

new

New cards
8

the constructor name followed by the parameter list

constructor signature or header

New cards
9

the method name followed by the parameter list

method signature or header

New cards
10

classes that create objects from primitive types, for exam­ple the Integer class and Double class

wrapper classes

New cards
11

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

null

New cards
12

Returns the absolute value of an int value

(which means no negatives).

Math method: int abs(int)

New cards
13

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

Math method: double pow(double, double)

New cards
14

Returns the positive square root of a double value.

method: double sqrt(double)

New cards
15

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

Math.random()

New cards
16

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

parameter list

New cards
17

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

overloading

New cards
18

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.

call by value

New cards
19

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

NullPointerException

New cards
20

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

non-static or object method

New cards
21

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

static method

New cards
22

The value returned from a method to the calling method

return value

New cards
23

objects of the String class that hold sequences of charac­ters.

strings

New cards
24

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

index

New cards
25

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

immutable

New cards
26

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

substring

New cards
27

returns the number of characters in a String object.

String method: int length()

New cards
28

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

String substring(int from, int to)

New cards
29

returns substring(from, length()).

String substring(int from)

New cards
30

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

int index­Of(String str)

New cards
31

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

boolean equals(String other)

New cards
32

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.

int compareTo(String other)

New cards
33

returns a single character at position index

substring(index, index+ 1)

New cards
34

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

autoboxing

New cards
35

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

unboxing

New cards
36

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

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

New cards
37

Returns the absolute value of a double value.

Math method: double abs(double)

New cards

Explore top notes

note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 24 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 44 people
Updated ... ago
4.5 Stars(2)
note Note
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 80 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7668 people
Updated ... ago
4.5 Stars(20)

Explore top flashcards

flashcards Flashcard42 terms
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard55 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard122 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard34 terms
studied byStudied by 12 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard75 terms
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard232 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard413 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard121 terms
studied byStudied by 60 people
Updated ... ago
5.0 Stars(1)