Vocab Flashcards

1
Q

Wrapper class

A

Wrapper classes provide a way to use primitive data types (int, boolean, etc..) as objects.
Use the capitals: Int not int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Autoboxing

A

automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

this

A

refers to the current object in the method or constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

new

A

used to create a new instance of a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Static variables

A

variables lifetime is the full time the program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Static method

A

-method belongs to the class not the instance of the class
-method is accessible to every instance of a class but methods defined in an instance are only able to be accessed by that object of the class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Instance variables

A

variable which is declared in a class but outside of constructors, methods, or blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Instance Constants

A

variable whose value never changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Polymorphism

A

ability of a class to provide different implementations of a method, depending on the type of object that is passed to the method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Inheritance

A

create new classes that inherit features of the superclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

super

A

constructor call

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

super.method()

A

call parent method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

default access

A

same class and same package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

private access

A

only that class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

protected access

A

Same class, same package, and different package subclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

public access

A

yes

17
Q

abstract class

A

restricted class that cannot be used to create objects

18
Q

abstract method

A

-no body

-can only be used in an abstract class

19
Q

interface

A

-a completely “abstract class” that is used to group related methods with empty bodies
-may not have member variables or method definitions

20
Q

typecast

A

assign a value of one primitive data type to another type

21
Q

instance of

A

test whether the object is an instance of the specified type (class or subclass or interface)

22
Q

abstract class vs interface

A

Abstract classes can have methods with implementation whereas interface provides absolute abstraction and can’t have any method implementations.

23
Q

Enumerated Types

A

type whose legal values consist of a fixed set of constants
ex)fall winter spring summer

24
Q

Array

A

int[] myNum = {10, 20, 30, 40};
myNum[2];
arr = insertX(n, arr, x, pos);

25
Q

Array list

A

ArrayList<Integer> arrlist = new ArrayList<Integer>(5);
arrlist.add(15);</Integer></Integer>

26
Q

Iterated for loop

A

for (Integer number : arrlist) {
System.out.println(“Number = “ + number);
}

27
Q

Map

A

Map<Integer, String> map = new HashMap<>();
map.put(1, “One”);
map.get(Object key_element)

28
Q

Set

A

Set<Obj> set = new HashSet<Obj> ();
s.add("Welcome");
s.remove("Welcome");</Obj></Obj>

29
Q

next vs nextLine()

A

nextLine() - returns all text up to a line break
next() - returns tokenized text. The next() method uses whitespace as the default delimiter.

30
Q

throw vs throws

A

throw - throw an exception explicitly (one) throws - declare multiple exceptions, separated by a comma

31
Q

@test

A

says the next method is a test

32
Q

@Before vs @BeforeClass

A

@Before - executed before each test
@BeforeClass - runs once before the entire test fixture

33
Q

UML ——->

A

shows dependence

34
Q

UML <——->

A

shows association

35
Q

UML ____> (solid line arrow)

A

connects a specialized element with a generalized element
(inheritance)