Skip to content

Instantly share code, notes, and snippets.

@ellbur
Created December 15, 2011 20:43
Show Gist options
  • Select an option

  • Save ellbur/1482783 to your computer and use it in GitHub Desktop.

Select an option

Save ellbur/1482783 to your computer and use it in GitHub Desktop.
The HotelRoom class
public class Hotel {
public static void main(String[] args) {
HotelRoom room = new HotelRoom();
room.setGuestName("Joe");
HotelRoom room2 = new HotelRoom();
System.out.println(room.getGuestName());
room.setGuestName("Melissa");
System.out.println(room.getGuestName());
}
}
class HotelRoom {
private String guestname;
HotelRoom() {
}
String getGuestName() {
return this.guestname;
}
void setGuestName(String x) {
this.guestname = x;
}
HotelRoom foo() {
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment