Skip to content

Commit 2565333

Browse files
authored
Merge pull request #368 from DieuMerci225/chapter9.6
Added listing tag to chapter9.6 to make the text more organized
2 parents 0c44ce9 + 3c7c9db commit 2565333

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

source/ch9_commonmistakes.ptx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
<p>
184184
Java is a statically typed language, meaning you must specify the type of objects that can be stored in a container like an <c>ArrayList</c>. If you forget to declare the type, the compiler will give you an error.
185185
</p>
186+
187+
<listing xml:id="unchecked-warning">
186188
<program language="java" interactive="activecode" line-numbers="yes">
187189
<code>
188190
// UncheckedWarningDemo.java
@@ -202,6 +204,7 @@
202204
} // End of class
203205
</code>
204206
</program>
207+
</listing>
205208
<p>
206209
This is a compiler warning, not an error, indicating a potential type safety issue. It occurs because you are calling the <c>add()</c> method on <c>rawList</c>, which is an <c>ArrayList</c> used as a raw type (i.e., without specifying a generic type like <c>&lt;String&gt;</c> or <c>&lt;Integer&gt;</c>).
207210
</p>

0 commit comments

Comments
 (0)