Hello Friends today I will explain Java techonology using Netbeans. In this projects we will learn how to create java console hotel menu projects step by step. We will also learn how to use netbeans and write a simple Java program using netbeans
Step 1
You should have any version of NetBeans installed in your machine. I have installed NetBeans IDE 8.1 open NetBeans
Step 2
Select Java language andJava Application in the projects section then click to next.
Step 3
Enter the project name -- my project name is Hotel 1click to finish.
Step 4
This is simple and easy to understand with comments section.
-
-
-
-
-
-
-
-
-
- package hotel;
-
-
-
-
-
-
-
- import java.util.Scanner;
- public class Hotel {
- int choice;
- String menu;
- void show() {
- Scanner s = new Scanner(System.in);
- System.out.println("Enter your choice");
- System.out.println("Enter 1 for Coffee");
- System.out.println("Enter 2 for Tea");
- System.out.println("Enter 3 for Cold Drink");
- choice = s.nextInt();
- if (choice == 1) {
- System.out.println("you have select Coffee");
- System.out.println("menu");
- menu = s.nextLine();
- }
- if (choice == 2) {
- System.out.println("you have select Tea");
- System.out.println("menu");
- menu = s.nextLine();
- }
- if (choice == 3) {
- System.out.println("you have select Cold drink");
- System.out.println("menu");
- menu = s.nextLine();
- }
- }
-
-
-
-
-
- public static void main(String[] args) {
- Hotel h = new Hotel();
- h.show();
-
- }
- }
Step 5
Below is the screenshot output
Thank you for reading. I hope this article was helpful for you. Please share any feedback or suggestions.