Question from the Java test

Compile the following Java code and explain the error.

Expert

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 278 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!