Question: 12. (4 marks) Consider the following code snippet and simple class public class abject1 private static int datal; private int data2; public object 1 (int
12. (4 marks) Consider the following code snippet and simple class public class abject1 private static int datal; private int data2; public object 1 (int di, int d2H datai -d, data2-d2, public int getDatal( return datal: public int getData2 f return data2i What is the output produced by the following statements object1 ol new object1 (5,7) bject1 o2 new Object1 (50, 70) System.out.printin(o1.getData10++01.getData2()) System.out.printin (o2.getData10+, o2.getData20)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
