Java Console 5 of 5

Output obtained by running the code 3 is as follows :



Picture
readLine() method will echo the charecters on the console.
Picture
readPassword() will never echo charecters on the console


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

readPassword()


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.


ALL about SCJP = SCJP 1.6, mock, certification, scjp 1.5 , scjp questions, scjp books, scjp hand written notes, scjp dumps, scjp trainings, scjp video tutorials, scjp simulators etc.