Question: What output would be produced by running the main method in the class below? (explain why) public class NumberTest { int a=0; static int

What output would be produced by running the main method in the class below? (explain why) public class NumberTest { int a=0; static int _c=0; public void f() { a++; c++; }//f public void p() { System.out.println(a+" "+c); }//p public static void main(String[] a){ NumberTest one = new NumberTest(); NumberTest two = new NumberTest(); one. f(); two.f(); one.p(); two.p(); }//main }//class NumberTest
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
