Skip to content

Commit 529a6c4

Browse files
authored
Merge pull request #360 from habibasorour/issue_351
Issue 351 fixed: Added listing
2 parents 8590e3b + 37789ec commit 529a6c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/ch9_commonmistakes.ptx

Lines changed: 3 additions & 1 deletion
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,8 +78,9 @@
7778
}//End of class
7879
</code>
7980
</program>
81+
</listing>
8082
<p>
81-
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.
83+
The error "';' expected" on line 7 of <c>Histo.java</c> in <xref ref="semicolon-error" text="type-global"/> 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>
8385

8486
</section>

0 commit comments

Comments
 (0)