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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!