Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception in thread "main" java.lang.NumberFormatException: For input string: ""
- at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
- at java.lang.Integer.parseInt(Integer.java:592)
- at java.lang.Integer.parseInt(Integer.java:615)
- at Simulation.getJob(Simulation.java:12)
- at Simulation.main(Simulation.java:58)
- //all of this is under main.
- m = Integer.parseInt( in.nextLine() );
- //make sure the file has stuff in it
- while(in.hasNext()){
- in.useDelimiter("n");
- //Create an array of type job to keep track of our number of jobs.
- Job[] jobs = new Job[m];
- line = in.next() + " ";
- token = line.split("\s+");
- for(int i = 1; i < m; i++){
- jobs[i] = getJob(in);
- System.out.println(jobs[i]);
- }
- }
- //getJob function is here:
- public static Job getJob(Scanner in){
- String[] s = in.nextLine().split(" ");
- int a = Integer.parseInt(s[0]);
- int d = Integer.parseInt(s[1]);
- return new Job(a,d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement