Create Class with public fields - Java Object Oriented Design

Java examples for Object Oriented Design:Access Level

Description

Create Class with public fields

Demo Code

class SimplePoint {
    public int x = 0;
    public int y = 0;
}
class SimpleRectangle {
    public int width = 0;
    public int height = 0;
    public SimplePoint origin = new SimplePoint();
}

Related Tutorials