Q:

method declaration

I haven't been programming for long and this is my first time declaring a method within my program and using this method in the program. In its simplicity, the program has the user enter a 5 digit zipcode and the method I created checks that the zipcode is only 5 characters and is all digits. When I use the method in the program no matter what I enter for the zipcode, the while statement runs asking me to input my zipcode again. This should only happen if you enter a string thats not five characters or a string without only digits. However, right now it is happening even when an actual zipcode is entered, leaving me to assume something is wrong with the method. I tried to be as clear as possible in the question but if any further clarification is needed I can try to clear things up, any info you can give would be appreciated. Here is my code:
import java.util.Scanner;

public class BarCode {
    public static void main(String[] args) {

        String zipcode;

        Scanner in = new Scanner(System.in);
        System.out.println("Please enter a 5 digit zipcode: ");
        zipcode = in.nextLine();

        while (checkInput(zipcode) == false) {
            System.out.println("You did not enter a 5 digit zipcode: ");
            zipcode = in.nextLine();
        } // end while

    } // ends main

    public static boolean checkInput(String zipcode) {
        boolean zipcodeLength = true;
        boolean zipcodeDigits = true;
        if (zipcode.length() != 5) {
            zipcodeLength = false;
        } // end if statement
        for (int i = 0; i <= zipcode.length(); i++) {
            if (!Character.isDigit(i)) {
                zipcodeDigits = false;
            } // end if statement
        } // end for statement
        if (zipcodeLength == false || zipcodeDigits == false) {
            return false;
        } // end if statement
        else {
            return true;
        } // end else statement
    } // end checkInput
}

A:

This is your problem : 
if(!Character.isDigit(i))

should be
if(!Character.isDigit(zipcode.charAt(i)))

