Skip to content

Commit 7799fe0

Browse files
committed
add listing tags
1 parent 8590e3b commit 7799fe0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

source/ch9_commonmistakes.ptx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<p>
6464
A common mistake in Java is to forget that every statement must end with a semicolon (<c>;</c>).
6565
</p>
66+
<listing xml:id="semicolon-error">
6667
<program language="java" interactive="activecode" line-numbers="yes">
6768
<code>
6869
// Histo.java
@@ -77,6 +78,7 @@
7778
}//End of class
7879
</code>
7980
</program>
81+
</listing>
8082
<p>
8183
The error "';' expected" on line 7 of <c>Histo.java</c> means that a semicolon is missing at the end of the statement <c>Scanner data = null</c>. In Java, every statement must be terminated with a semicolon (<c>;</c>) to indicate its completion. The arrow points to <c>null</c> because that's where the compiler expected to find the semicolon.
8284
</p>

0 commit comments

Comments
 (0)