Java Console 5 of 5
Output obtained by running the code 3 is as follows :
So the major differences between readLine() and readPassword are as follows : ( Read them carefully )
readLine()
Method return type is String. So the input entered in the console is stored in string format.
Echo input on the console
Method return type is String. So the input entered in the console is stored in string format.
Echo input on the console
readPassword()
Method return type is character array. So the entered input will be stored as char[].
Will never echo input on the console.
Method return type is character array. So the entered input will be stored as char[].
Will never echo input on the console.
Done !!! You have completed Java Console API.