Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Demo {
- private static String[] footballPlayers = {"Brady", "Rodgers", "Favre", "Gordon", "OBJ"};
- // Main
- public static void main(String[] args){
- // print names of football players
- System.out.println(footballPlayers[0]);
- System.out.println(footballPlayers[1]);
- System.out.println(footballPlayers[2]);
- System.out.println(footballPlayers[3]);
- System.out.println();
- // using a for loop
- // Until player index is < 5
- for (int playerIndex=0; playerIndex < footballPlayers.length; playerIndex++){
- System.out.println(footballPlayers[playerIndex]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement