Structures definition and initialization in Java
Forums:
//In Java there are no structures
class Point {
public int x, y;
}
Point p1 = new Point();
int x1 = p1.x;
//x1 is 0
Point p2;
int x2 = p2.x; //<- Error
- Log in to post comments