Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static final String zipCodePattern = "\\d{5}(-\\d{4})?";

    public static boolean isValidZipCode(String zip) {
        return zip.matches(zipCodePattern);
    }
}