Question: This question is about static methods. Consider the following class class Point { public double x; public double y; private static pointCount =0; public static
This question is about static methods. Consider the following class class Point \{ public double x; public double y; private static pointCount =0; public static Point createPoint(double x, double y ) \{ Point p= new Point ( ); this. x=x; this. y=y; pointCount++; return p; \} Why is this code incorrect (that is, why will it be rejected by the compiler)? Select one: a. cannot be used inside the static method b. The constructor of cannot be called inside the static method c. The class variable cannot be used inside the static method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
