Created
December 15, 2011 20:43
-
-
Save ellbur/1482783 to your computer and use it in GitHub Desktop.
The HotelRoom class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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