Solved

The File Numbers

Question 89

Essay

The file numbers.txt contains only positive integers. We want to calculate the maximum value among them. Complete the code below.
int max = 0;
try
{
Scanner scan = new Scanner( new File( "numbers.txt" ) );
// Your code goes here
scan.close( );
}
catch( Exception e )
{ }
System.out.println( "max = " + max );

Correct Answer:

verifed

Verified

while ( scan.hasNext...

View Answer

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