public class Arrays
{
public static void main (String[] args)
{
int[] arrayOne = new int[6];
//6 empty spots
int[] arrayTwo = {5, 10, 15, 20, 25, 30};
//System.out.println (arrayTwo[3]);
//arrayTwo[3] = 18;
//System.out.println (arrayTwo[3]);
//arrayOne[4] = 9;
//arrayOne[5] = "Fish" wont work bc it only holds int, as shown at top
//System.out.println ();
//System.out.println ();
// starting new stuffs
//for (int i = 0; i <= 6; i++)
//{
// System.out.println (arrayTwo[i]);
//}
// //out of bounds
//if (args[0] = "UUDDLRLRBAS")
//lives += 1000000000;
//shelley was also here
//I know. I'm EVERYWHERE! :D
//EVERYWHERE!
double[] arrayThree = new double[4];
String[] arrayFour = {"Fudge", "Cookies", "Cake"};
//System.out.println ("Good Morning, " +args[0]);
for (int i = 0; i < arrayTwo.length; i++)
{
//int current = arrayTwo[i];
//System.out.println (current * 100 + "%");
arrayTwo[i] = 0;
System.out.print (arrayTwo[i]);
}
System.out.println();
//"foreach"
for (String current : arrayFour)
{
current = "Fish";
System.out.print (current);
}
}
}
{
public static void main (String[] args)
{
int[] arrayOne = new int[6];
//6 empty spots
int[] arrayTwo = {5, 10, 15, 20, 25, 30};
//System.out.println (arrayTwo[3]);
//arrayTwo[3] = 18;
//System.out.println (arrayTwo[3]);
//arrayOne[4] = 9;
//arrayOne[5] = "Fish" wont work bc it only holds int, as shown at top
//System.out.println ();
//System.out.println ();
// starting new stuffs
//for (int i = 0; i <= 6; i++)
//{
// System.out.println (arrayTwo[i]);
//}
// //out of bounds
//if (args[0] = "UUDDLRLRBAS")
//lives += 1000000000;
//shelley was also here
//I know. I'm EVERYWHERE! :D
//EVERYWHERE!
double[] arrayThree = new double[4];
String[] arrayFour = {"Fudge", "Cookies", "Cake"};
//System.out.println ("Good Morning, " +args[0]);
for (int i = 0; i < arrayTwo.length; i++)
{
//int current = arrayTwo[i];
//System.out.println (current * 100 + "%");
arrayTwo[i] = 0;
System.out.print (arrayTwo[i]);
}
System.out.println();
//"foreach"
for (String current : arrayFour)
{
current = "Fish";
System.out.print (current);
}
}
}
(0) Comments
Post a Comment