How can i solve these Exercises ? On Java Eclipse
When i just copy it i get 12 error i know i'm doing it wrong but what is right!
Exercises 1
What do each of the following print?
System.out.println(2 + "bc"); prints: 2bc
System.out.println(2 + 3 + "bc"); prints: 5bc
System.out.println((2+3) + "bc"); prints: 5bc
System.out.println("bc" + (2+3)); prints: bc5
System.out.println("bc" + 2 + 3); prints: bc23
Explain each outcome.
Exercises 2
Suppose that a variable a is declared as int a = 2147483647 (or equivalently,Integer.MAX_VALUE). What do each of the following print?
System.out.println(a);
System.out.println(a + 1);
System.out.println(2 - a);
System.out.println(-2 - a);
System.out.println(2 * a);
System.out.println(4 * a);
Explain each outcome.