What is the result?

Given the code fragment:

What is the result?
A. Sum is 600
B. Compilation fails at line n1.
C. Compilation fails at line n2.
D. A ClassCastException is thrown at line n1.
E. A ClassCastException is thrown at line n2.

Download Printable PDF. VALID exam to help you PASS.

2 thoughts on “What is the result?

  1. javac Testint.java
    Testint.java:7: error: inconvertible types
    String s4=(String)(s3*s2);
    ^
    required: String
    found: long
    1 error

Leave a Reply

Your email address will not be published.