Guest User

Untitled

a guest
Nov 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class MainClass {
  2.  
  3. /**
  4. * @param args
  5. */
  6. public static void main(String[] args) {
  7. // TODO Auto-generated method stub
  8. System.out.println(invoer("test"));
  9. }
  10.  
  11.  
  12. private static int invoer(String input){
  13. int aantal = -1;
  14. try{
  15. aantal = Integer.parseInt(input);
  16. }
  17. catch(Exception e){
  18. System.out.println("geen getal");
  19. }
  20. return aantal;
  21. }
  22. }
Add Comment
Please, Sign In to add comment