Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. package exceptions;
  2.  
  3. public class ExeptionsExercise1 {
  4.  
  5. public static void main(String[] args) {
  6. String eingabe = "19%";
  7.  
  8. try {
  9. int zahl = Integer.valueOf(eingabe);
  10. } catch (NumberFormatException nfe) {
  11. System.out.println("\"" + eingabe + "\"" + "ist keine gültige Eingabe.");
  12. }
  13.  
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement