Question: java question Scanner input = new Scanner(a1.dat); int mission = input.nextInt(); boolean onMission = input.nextBoolean(); String name = input.nextLine(); System.out.println(name + has done +

java question

Scanner input = new Scanner(a1.dat);

int mission = input.nextInt();

boolean onMission = input.nextBoolean();

String name = input.nextLine();

System.out.println(name + "has done " + mission + " missions and on Mission states is " + onMission);

a1.dat file contain:

B

false

Crew 41

what is the output? And when i run it i get error "Exception in thread "main" java.util.InputMismatchException", can you fix this issue like create file a1.dat and the code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!