Answers | Latest Version (2024/2025) Expert
Verified
Term
, only if an exception is thrown in the
only if there is no exception thrown
try block
after the try or catch blocks before the try block executes
Don't know?
2 of 69
Term
Assuming a Scanner object exists and can be referenced with a
variable scnr, what is the correct method that should be used for
String?
Give this one a try later!
scnr.nextboolean() name = scnr.next();
scnr.nextDouble() scnr.nextLine()
Don't know?
3 of 69
Term
,the following method is intended to return the substring starting at
index i until the end. what is the most appropriate precondition for the
methods so that it does not throw an exception?
/missing precondition/
public String getiToEnd(String str, int i){
return str.substring(i, str.length( ));
}
Give this one a try later!
.size() .remove()
/Precondition; 0 <= i <
.add()
str.length( ) /
Don't know?
4 of 69
Term
given the following definitions:
public abstract class Manager extends Employee()
public class Executive extends Manager()
what if anything, is wrong with the following code?
public class hrSystem{
public void payRaise(){
, Manager m = new Manager();
}
}
Give this one a try later!
The code is correct and will compile
The hrsystem class must be abstract
successfully
Compiler error because
Manager is abstract so an The manager class must be public
instance cannot be created.
Don't know?
5 of 69
Term
what is the ArrayList method that fulfills this function:
adds a new element to the end of an ArrayList
Give this one a try later!
.len() .insert()
.append() .add()