Problem statement:
what will be the output of the following code?
what will be the output of the following code?
- class ExecutionEight {
- public int number = 0;
- }
- public class ExecutionSeven {
- public void doIt(int i, ExecutionEight e) {
- i = 5;
- e.number = 8;
- }
- public static void main(String[] args) {
- int x = 0;
- ExecutionEight e = new ExecutionEight();
- new ExecutionSeven().doIt(x, e);
- System.out.println(x + " " + e.number);
- }
- }
Output:
0 8
No comments:
Post a Comment