Skip to main content

Section 9.2 Forgetting a Semicolon

A common mistake in Java is to forget that every statement must end with a semicolon (;).
Listing 9.2.1.
The error "โ€™;โ€™ expected" on line 7 of Histo.java in Listingย 9.2.1 means that a semicolon is missing at the end of the statement Scanner data = null. In Java, every statement must be terminated with a semicolon (;) to indicate its completion. The arrow points to null because thatโ€™s where the compiler expected to find the semicolon.
You have attempted of activities on this page.