The ClassCastException is thrown to show an invalid cast. It indicates that the code has attempted to cast an object to a subclass of which it is not an instance. It is also thrown when an attempt is made to add an incompatible object to a collection.
The syntax of the ClassCastException is as follows:
- Click here to get free master-ciw-enterprise-developer Master CIW Enterprise Developer exam practice questions.
- Pass SCBCD in first attampt.
- Click here to download scdjws test study guide and practice question.
- Download free practice test for scjp SCJP exam.
- Click here to get free scjp-5-0 SCJP 5/6 exam practice questions.
- Download free practice test for scmad SCMAD exam.
- Click here to get free scwcd SCWCD exam practice questions.
- Pass Java 5.0 in first attampt.
- Download free practice test for CX310-056 SCJP 5.0 Java Upgrade exam.
- Download free practice test for CX310-066 SCJP Upgrade exam.
Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
