Solved

Which Statement Is True About the Code Snippet Below

Question 44

Multiple Choice

Which statement is true about the code snippet below?
Public static void main(String[] args)
{
Scanner in = new Scanner(System.in) ;
ArrayList<Double> inputs = new ArrayList<Double>() ;
Int ind = 0;
While (in.hasNextDouble() )
{
Inputs.set(ind, in.nextDouble() ) ;
Ind++;
}
}


A) The code adds all input numbers to the array list
B) The code has compile-time error
C) The array list is full after 100 numbers are entered
D) The code has a run-time error

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions