Java program for CS232