Correct is B. Because the ClassCastException occurs when we try to cast to a PRIMITIVE variable type that does not hold the variable's value. String is not a primitive type and a primitive type cannot cast to a non-primitive type, error occurs when executing code on line n1.
incompatible types: int cannot be converted to java.lang.String!
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
vic88
1 week, 6 days agoarjunrawatirissoftware
1 year, 2 months agofvelazqueznava
1 year, 2 months agoduydn
1 year, 3 months agoNabilBenAsker
1 year, 5 months agoNabilBenAsker
1 year, 5 months agoKolodets
1 year, 7 months agoAnkit1010
1 year, 10 months agocarloswork
2 years, 1 month agoUAK94
2 years, 2 months agoiSnover
2 years, 2 months agoRdharma
2 years, 2 months agoPhilip0908
2 years, 3 months agoTD844
2 years, 3 months agoRoxyFoxy
2 years, 3 months ago