0% found this document useful (0 votes)
12 views1 page

Java Array Example with Cars

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Java Array Example with Cars

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

public class Main {

public static void main(String [] args) {

// array = used to store multiple values in a single variable

String[] cars = new String [3];

cars[0] = "Camaro";
cars[1] = "Corvette";
cars[2] = "Tesla";

for(int i=0; i<[Link]; i++) {


[Link](cars[i]);
}

}
}

You might also like