Java tutorial
//package com.java2s; //License from project: Apache 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", angle)); } }