Java is a purely object-oriented language. The class is its important constituent unit. Then, in actual programming, we will customize some classes, such as the point
<span style= "FONT-SIZE:14PX;" >public class Point {public Point () {lat=0.0; lng=0.0;} Public double Getlat () {return Lat;} Public double getlng () {return Lng;} public void Setlat (double pLat) {Lat=plat;} public void setlng (double plng) {lng=plng;} Private double lat;private double Lng;} </span>
For example, such an entity class, we often want to use its object array. However, the Declaration and initialization of an object array in Java differs from the Declaration and initialization of its fixed type. Please see below.
<span style= "FONT-SIZE:14PX;" >//init class Pointpoints=new point[totalpoints];//statement of Points array//initing for (int i=0;i<totalpoints; i++) {points[i]=new point ();} </span>
Java class object array declaration and initialization