Skip to content

Instantly share code, notes, and snippets.

@SlayterDev
Created July 8, 2014 14:39
Show Gist options
  • Save SlayterDev/cbb13486daab4809e75f to your computer and use it in GitHub Desktop.
Save SlayterDev/cbb13486daab4809e75f to your computer and use it in GitHub Desktop.
Array example
public class Arrays {
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] names = new String[5];
names[0] = "Garret";
names[1] = "Calvin";
names[2] = "Ben";
names[3] = "James";
names[4] = "Jeffery";
System.out.println("Brad's Programming 101:");
for (int i = 0; i < names.length; i++) {
System.out.println(names[i]);
}
System.out.println();
char[] myName = {'B', 'r', 'a', 'd'};
System.out.println("My name is: ");
for (int i = 0; i < myName.length; i++) {
System.out.print(myName[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment