| What will be the result of attempting to compile and run the following program? public class MyClass { public static void main(String[] args) { String a, b, c; c = new String("mouse"); a = new String("cat"); b = a; a = new String("dog"); c = b; System.out.println(c); } } Select the one correct answer. -
The program will fail to compile. -
The program will print mouse when run. -
The program will print cat when run. -
The program will print dog when run. -
The program will randomly print either cat or dog when run. |