Solved

Compare Lines 22-23 with 27-28 and Explain How the Results

Question 58

Essay

Compare lines 22-23 with 27-28 and explain how the results will differ.
21 System.out.println( "\nUsing the enhanced for loop:" );
22 for ( Integer currentInteger : list )
23 System.out.print( currentInteger + "\t" );
24 System.out.println( );
25
26 System.out.println( "\nUsing unboxing and enhanced for loop:" );
27 for ( int currentInt : list ) // unboxing
28 System.out.print( currentInt + "\t" );
29 System.out.println( );

Correct Answer:

verifed

Verified

In both cases, the enhanced for loop is ...

View Answer

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

Related Questions