Correct the Java syntax in the sample code