Where is the error in this code sequenceexplain what the


This code prints all elements of the array geo
for ( int i = 0; i < geo.length; i++ )
{
//the code is missing here

}
__________________________________________________________________
Where is the error in this code sequence?
// a is an ArrayList of strings
// a has already been declared and instantiated
a.size ( ) = 10;
________________________________________________________________

You coded the following in the Test.java class:
public static void main (string) [ ] args)
{
// cars is an ArrayList of Auto Objects
// cars has already been declared and instantiated
for ( Auto a ; cars ) // line 12
{
System.out.println (a. to string ( ) );
} // line 15
} //line 16
When you compile, you get the following message:
Test.java:12 '; 'expected
for ( Auto a ; cars ) // line 12
^
1 error
Explain what the problems are and how to fix them.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Where is the error in this code sequenceexplain what the
Reference No:- TGS01245894

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)