What is wrong with this function??

From: bunallo (nmnm_at_alala.com)
Date: 02/26/05


Date: Sat, 26 Feb 2005 19:59:51 +0100

This function will not compile:

    public int getInt(int p){

        switch(p){
        case 1:
            return 2;
        case 2:
            return 3;
        case 3:
            return 3;
        default:
            System.out.println("No such input allowed");
        }
    }

But it returns an int!