I'm stumped as to why this code is throwing a fit over not having a return statement when I do have one included. Any help would be appreciated!
Code in question:
public static int getSize()
{
Scanner kbd = new Scanner(System.in);
int x = 1;
while(x==1){
System.out.println("Enter the size (>0): ");
int n = kbd.nextInt();
if (n>0){
x--;
return n;
}
}
}