Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class arrayLoop{
- public static void main (String[] args){
- String []students= new String[5];
- String pupil;
- for (int i=0; i<students.length; i++) {
- Scanner userInput = new Scanner(System.in);
- System.out.print("Enter a student name: ");
- pupil=userInput.next();
- students[i] = pupil;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment