Advertisement
mrScarlett

arrayLoop

Oct 2nd, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class arrayLoop{
  3. public static void main (String[] args){
  4. String []students= new String[5];
  5. String pupil;
  6. for (int i=0; i<students.length; i++) {
  7.  
  8. Scanner userInput = new Scanner(System.in);
  9. System.out.print("Enter a student name: ");
  10. pupil=userInput.next();
  11. students[i] = pupil;
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement