The Artima Developer Community
Sponsored Link

Java Buzz Forum
Reading input and password from command line in Java using java.io.Console - Example tutorial

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
Reading input and password from command line in Java using java.io.Console - Example tutorial Posted: May 18, 2013 7:40 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: Reading input and password from command line in Java using java.io.Console - Example tutorial
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
Java6 added a new utility class for reading input data from character based devices including command line. java.io.Console can be used to read input from command line, but unfortunately it doesn't work on most of IDE like Eclipse and Netbeans. As per Javadoc call to System.Console() will return attached console to JVM, if it has been started interactive command prompt or it will return null if JVM has been started using a background process or scheduler job. Anyway java.io.Console not only provides way to read input from command prompt or Console but also reading passwords from console without echoing it. Console.readPassword() method reads password and returns a character array and password is masked during entering so that any peeping tom can not see your password while you are entering it. here is a code example of How to read password and input from command prompt or console using java.io.Console. By the way apart from Console, you can also use Scanner or BufferedReader to read input from command prompt, as shown in this example.
Read more ยป

Read: Reading input and password from command line in Java using java.io.Console - Example tutorial

Topic: 5 pioneering paths for software development's new frontier Previous Topic   Next Topic Topic: The 14 characters you meet as a coder

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use