Kaplan Self Test Notes Flashcards
Can implemented methods change the return type?
No
What are bytes initialised by?
0b
What can be expected with varargs (…)?
Nothing to the biggest array ever
What kind of exception is a ClassNotFoundException?
A checked exception
How much you ensure a float is designed when passing a value?
A whole number with nothing special
Or with f attached to the end of a decimal value
What kinda of exception is an IOException?
A checked exception
What are exceptions?
Exceptions are used to group and differentiate between different error types
What do normal break statements break?
Inner most iterative blocks
Can break statements break if statements?
No
Does String have replace method?
Yes.
string1.replace(“Dog”, “Cat”);
When running a java source file, what is the starting command, java or javac?
java
Can final classes be subclassed?
No
What determines which members are accessible?
Reference types
Where do methods get called from?
The object
Are you required to catch IllegalArgumentExceptions?
No, they are a subclass of RuntimeException
What must you ensure when returning an array?
Return a clone and not the actual reference to the whole array
How do you access the sixth value in an array and then in an ArrayList?
arrayName[6];
arrayListName.get(6);
Are you required to catch UnsupportedOperationException?
No, it is a subclass of RuntimeException
What does this mean?
? 1:0
Will return either 1 for true or 0 for false
Can a default constructor be overloaded in the same class?
No, that makes no sense
Can a default constructor be overloaded by the subclass?
Yes
What determines how methods are called?
Objects
Which requires less low-level implementation - arrays or arraylists?
ArrayLists
What is the same for both Strings and Integers that makes passing and returning something to watch out for?
Both are immutable