Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class hotel {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- room lolObject = new room ();
- System.out.println("Hello");
- System.out.println("How many people are in your party? ");
- String name = input.nextLine();
- lolObject.simpleMessage(name);
- }
- }
- -----------------------------------------------------------------------------------------------------------
- public class room {
- public void simpleMessage(String name){
- if (name.equals("2")) {
- System.out.println("We do not have any rooms that are for 2 people");
- }
- else{ System.out.println("We have space for you");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement