Code example for InputMismatchException

0
            return; 
        } 
        try { 
            System.out.println("Zadejte cislo portu:");
            port = sc.nextInt();
            if(port < 0 || port > 65535) throw new InputMismatchException();
            soket = new Socket(addr, port);
            sc.nextLine();
        } catch (InputMismatchException e) {
            System.out.println("Napis cislo portu a ne naky nesmysly!");
            return; 
        } 
        catch (ConnectException e) {
            System.out.println("Napis spravny cislo portu a ne naky nesmysly!");
            return; 
        } 
        catch (IOException e) {
            System.out.println("Nejaky problem s IO.");
            return; 
        } 
        File file;