Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.swing.SwingConstants;

public class Main {
    public static void validateDirection(int direction) {
        if (direction != SwingConstants.NORTH && direction != SwingConstants.EAST
                && direction != SwingConstants.SOUTH && direction != SwingConstants.WEST) {
            throw new IllegalArgumentException("invalid direction");
        }
    }
}