Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exceptions;
- public class ExeptionsExercise1 {
- public static void main(String[] args) {
- String eingabe = "19%";
- try {
- int zahl = Integer.valueOf(eingabe);
- } catch (NumberFormatException nfe) {
- System.out.println("\"" + eingabe + "\"" + "ist keine gültige Eingabe.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement