
How to get input from command line in java ?

Hi please Find the code for inputting data from the command line
System.out.println("Please Input A Number");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String data = br.readLine();
System.out.println("data is- " + data);
When you will run this code you will find the output as
Please Input A Number 2 data is- 2