Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { static void checkAngle(int angle) { if ((angle < 0) || (angle > 360)) throw new IllegalArgumentException(String.format("Illegal angle %d: must be >=0 and <= 360", new Object[] { Integer.valueOf(angle) })); } }