Answer the question
In order to leave comments, you need to log in
(java errors) Why does try catch interfere with further code execution?
sith[s] = new Sith();
System.out.print("Enter sith's name: ");
sith[s].name = in.next();
System.out.print("Enter the count of health points: ");
try{sith[s].health = in.nextInt();}catch(Exception e){System.out.println("He will have 100hp");}
System.out.print("Enter the value of power: ");
try{sith[s].power = in.nextByte();}catch(Exception e){System.out.println("He will have base power (1)");}
sith[s].health = in.nextInt();
send the "#" character to the input here, for example, the following outputs to the console: Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question