How to Get Input from Console in Java

To start with, you need to determine the Operating System that is being used. To begin with, you have to launch the control panel. The command to launch the same varies in the Windows based Operating system and the MAC based Operating...
Method 1 of 3:

For the Windows OS

  1. How to Get Input from Console in Java Picture 1How to Get Input from Console in Java Picture 1
    Click on the Start (Windows) Button.
  2. How to Get Input from Console in Java Picture 2How to Get Input from Console in Java Picture 2
    Navigate to the Control Panel.
  3. How to Get Input from Console in Java Picture 3How to Get Input from Console in Java Picture 3
    Find the Java Icon and double click on the same to open it.
  4. How to Get Input from Console in Java Picture 4How to Get Input from Console in Java Picture 4
    Once you enter the Control Panel, navigate to the tab named Advanced. Next, navigate to the Heading named as Java Console. Once you access the same, click on the radio button named Show Console. Next Click on Apply and then on the button named OK.
  5. How to Get Input from Console in Java Picture 5How to Get Input from Console in Java Picture 5
    Once you access the console, there are a number of different command prompts available to you. Select the appropriate one to complete the task. You can read the data from the console in two different ways.
    1. Buffered Reader.The first way is via the Buffered Reader command. The command for the same is shown below.
    2. Scanner .The second method is to use the Scanner command. The details of this command can be seen below
Method 2 of 3:

For the Windows 8 (and above)

  1. How to Get Input from Console in Java Picture 6How to Get Input from Console in Java Picture 6
    Click on the logo and W simultaneously.
  2. How to Get Input from Console in Java Picture 7How to Get Input from Console in Java Picture 7
    Search for Java Control Panel
  3. How to Get Input from Console in Java Picture 8How to Get Input from Console in Java Picture 8
    Click the icon to access the same.
  4. How to Get Input from Console in Java Picture 9How to Get Input from Console in Java Picture 9
    Once you enter the Control Panel, navigate to the tab named Advanced. Next, navigate to the Heading named as Java Console. Once you access the same, click on the radio button named Show Console. Next Click on Apply and then on the button named OK.
  5. How to Get Input from Console in Java Picture 10How to Get Input from Console in Java Picture 10
    Once you access the console, there are a number of different command prompts available to you. Select the appropriate one to complete the task. You can read the data from the console in two different ways.
    1. Buffered Reader.The first way is via the Buffered Reader command. The command for the same is shown below.
    2. Scanner.The second method is to use the Scanner command. The details of this command can be seen below
Method 3 of 3:

For the Mac OS

  1. How to Get Input from Console in Java Picture 11How to Get Input from Console in Java Picture 11
    Click on the logo of Apple located on the top left hand corner
  2. How to Get Input from Console in Java Picture 12How to Get Input from Console in Java Picture 12
    Navigate to the option named System Preferences
  3. How to Get Input from Console in Java Picture 13How to Get Input from Console in Java Picture 13
    You will notice the icon for Java.
  4. How to Get Input from Console in Java Picture 14How to Get Input from Console in Java Picture 14
    Click on the same to access the control panel.
  5. How to Get Input from Console in Java Picture 15How to Get Input from Console in Java Picture 15
    Navigate to the tab named Advanced. Next, navigate to the Heading named as Java Console. Once you access the same, click on the radio button named Show Console. Next Click on Apply and then on the button named OK.
  6. How to Get Input from Console in Java Picture 16How to Get Input from Console in Java Picture 16
    Once you access the console, there are a number of different command prompts available to you. Select the appropriate one to complete the task. You can read the data from the console in two different ways.
    1. Buffered Reader.The first way is via the Buffered Reader command. The command for the same is shown below.
    2. Scanner.The second method is to use the Scanner command. The details of this command can be seen below
4.5 ★ | 2 Vote