Kaplan Self Test Notes Flashcards

1
Q

Can implemented methods change the return type?

A

No

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

What are bytes initialised by?

A

0b

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

What can be expected with varargs (…)?

A

Nothing to the biggest array ever

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

What kind of exception is a ClassNotFoundException?

A

A checked exception

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

How much you ensure a float is designed when passing a value?

A

A whole number with nothing special

Or with f attached to the end of a decimal value

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

What kinda of exception is an IOException?

A

A checked exception

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

What are exceptions?

A

Exceptions are used to group and differentiate between different error types

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

What do normal break statements break?

A

Inner most iterative blocks

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

Can break statements break if statements?

A

No

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

Does String have replace method?

A

Yes.

string1.replace(“Dog”, “Cat”);

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

When running a java source file, what is the starting command, java or javac?

A

java

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

Can final classes be subclassed?

A

No

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

What determines which members are accessible?

A

Reference types

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

Where do methods get called from?

A

The object

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

Are you required to catch IllegalArgumentExceptions?

A

No, they are a subclass of RuntimeException

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

What must you ensure when returning an array?

A

Return a clone and not the actual reference to the whole array

17
Q

How do you access the sixth value in an array and then in an ArrayList?

A

arrayName[6];

arrayListName.get(6);

18
Q

Are you required to catch UnsupportedOperationException?

A

No, it is a subclass of RuntimeException

19
Q

What does this mean?

? 1:0

A

Will return either 1 for true or 0 for false

20
Q

Can a default constructor be overloaded in the same class?

A

No, that makes no sense

21
Q

Can a default constructor be overloaded by the subclass?

A

Yes

22
Q

What determines how methods are called?

A

Objects

23
Q

Which requires less low-level implementation - arrays or arraylists?

A

ArrayLists

24
Q

What is the same for both Strings and Integers that makes passing and returning something to watch out for?

A

Both are immutable

25
Q

What is the default size of StringBuilder?

A

16

26
Q

What happens to the size of a StringBuilder object if it is created with a string of size 10.

A

Size expands to 26: default 16 plus 10