X-Received: by 10.66.227.7 with SMTP id rw7mr1603904pac.19.1362061703977; Thu, 28 Feb 2013 06:28:23 -0800 (PST) X-Received: by 10.50.149.132 with SMTP id ua4mr1051180igb.8.1362061703877; Thu, 28 Feb 2013 06:28:23 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!xmission!news.snarked.org!newsfeed.news.ucla.edu!usenet.stanford.edu!su1no209565pbb.0!news-out.google.com!ov8ni22355pbb.1!nntp.google.com!jn4no16256266pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 28 Feb 2013 06:28:23 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=122.161.206.44; posting-account=6SonuQoAAACzSakS5dCECcJQe6ylLrzY NNTP-Posting-Host: 122.161.206.44 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Input from Console From: subhabangalore@gmail.com Injection-Date: Thu, 28 Feb 2013 14:28:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:22617 Dear Group, I am trying to learn Java. I was trying to write a code for input from Console. I found two ways to do it. One is by using import java.io.*; and the other is, import java.util.Scanner; If I assign a class name and start the console input from public static void main both works fine. But as I want to declare one function for it and like to call it in main body. I am not being able to do that. If any one of the learned members can kindly suggest it. Regards, Subhabrata.