Question from the Java test

Compile the following Java code and explain the error.

Hard

What is the result of callingdoSomething() method of classMyClass

class MyClass {
    var s1 = "s1";

    public void doSomething() {
        var s2 = "s2";
        System.out.println(s1 + s2);
    }
}
Author: LoïcStatus: PublishedQuestion passed 340 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!