#what are instances

1 messages · Page 1 of 1 (latest)

void furnace
amber shale
#

essentially yes, with new you can "instantiate" your class, so like you said, basically make an object from it
as for the methods, if they're not static, they're tied to the object, so you can use object.method()

dry flare
#
public class House {
    public String address;
    public House(String address) (
        this.address = address;
    }
}

public void Main(String args[]) {
    House house1Instance = new House("188 anystreet");
    House house2Instance = new House("189 anystreet");
}```
#

Instances