-5

When I run this code, it just prints listlist pre-requisite 1 pre-requisite 2. And it does not allow for the user to input prerequisite 1 And prerequisite 2. Please help.

public static String Info(Scanner my)
{
     System.out.println(“How many pre-requisites does the course     
         have”);        
         Int NumPreReq1= my.nextInt();
         For ( i=1; i<=NumPreReq1; I++){
             System.out.println(“list pre-requisite 1”);
             String PreReq = my.nextLine();
         }
       Return PreReq; 
 }
aek8
  • 319
  • 1
  • 8
  • 22
Ishla
  • 1

1 Answers1

0

Try my.next()

Hope this helps....

anon
  • 7