java sample codes.