Basic Operations in Java: Arithmetic and Logical

Java String Concatenation: Rules, Examples, and Unicode Encoding

1/4

Given:

class Feline {
    public static void main(String[] args) {
        Long x = 42L;
        Long y = 44L;
        System.out.print(" " + 7 + 2 + " ");
        System.out.print(foo() + x + 5 + " ");
        System.out.println(x + y + foo());
    }

    public static String foo() {
        return "foo";
    }
}

What is the result?

Comments