public class WesternTown {
int stables;
int saloon;
int yearEstablished;
int troublemaker;
String sheriffsname;
String location;
public WesternTown() {
stables=3;
location="Wesrtern America";
yearEstablished=1850;
}
public WesternTown(String name) {
sheriffsname = name;
}
public static void main (String [] args){
WesternTown newtown = new WesternTown();
WesternTown newname = new WesternTown("SHERIFFER");
System.out.println("stables: " + newtown.stables);
System.out.println("saloon: " + newtown.saloon );
System.out.println("sheriffs: " + newtown.sheriffsname );
System.out.println("troublemaker: " + newtown.troublemaker );
System.out.println("location: " + newtown.location );
System.out.println("yearEstablished: " + newtown.yearEstablished );
System.out.println("The Name is: " + newname.sheriffsname );
}
}