Solved

Which Statement Is True About the Code Snippet Below

Question 94

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents