homeworks in java