I am trying to limit a users input for their student ID to a length of 8 characters but when I use input.length() it tells me I cannot invoke length() on a primitive type int. Is there any way I can easily fix/achieve what I desire another way? The error occurs on the fourth line.
input.nextLine();
System.out.print("Please enter your Student ID: "); //Prompts for Student ID
int studentId = input.nextInt();
if(studentId.length() != 8)
{
System.out.println("Student ID must be 8 characters");
}