class project using threads in java