Skip to content

Commit 53bf752

Browse files
committed
add listing to txt
1 parent bafd5ef commit 53bf752

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/ch9_commonmistakes.ptx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
</program>
168168
</listing>
169169
<p>
170-
This error message occurs when you forget to use the <c>new</c> keyword to instantiate an object.
170+
The error message in <xref ref="new-keyword-error" text="type-global"/> occurs when you forget to use the <c>new</c> keyword to instantiate an object.
171171
Specifically, on line 8 of <c>Histo.java</c>, <c>data = Scanner(new File("test.dat"));</c> leads to a 'cannot find symbol' error.
172172
While the message states 'symbol: method Scanner(File)', this can be misleading.
173173
Java incorrectly interprets <c>Scanner()</c> as an attempt to call a static method named <c>Scanner</c> within the <c>Histo</c> class

0 commit comments

Comments
 (0)