Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By jim829

Thread: Which is the best method for input in java?

  1. #1
    rv.daredevil is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Which is the best method for input in java?

    please explain it also i am new to java and i come from a c++ background what is java's counterpart of cin

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,329
    Rep Power
    5

    Default Re: Which is the best method for input in java?

    Check out the Java tutorials (see my signature) as they cover this (and much more). The best method for input depends on the application. Database related, file processing, interactive?

    I used to program in C but not C++ or C#. I have to assume cin is a console input file descripter. So one answer would be to use System.in in conjunction with a Scanner reference. Other methods might be via textfields or documents.

    Regards,
    Jim
    quad64bit likes this.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    Wizard0860 is offline Member
    Join Date
    Nov 2012
    Posts
    29
    Rep Power
    0

    Default Re: Which is the best method for input in java?

    you could have textfields, java option panes, or just simply scanners.

  4. #4
    rv.daredevil is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Re: Which is the best method for input in java?

    thnx help appreciated

  5. #5
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    758
    Rep Power
    8

    Default Re: Which is the best method for input in java?

    You can also use the java.io.Console class. You can obtain an instance of Console object using System.console(). If the current system doesn't support a console this method will return null.

Similar Threads

  1. void input method
    By mwimpelberg in forum New To Java
    Replies: 9
    Last Post: 02-04-2013, 05:40 AM
  2. how to enter input method name for getMethod(------)
    By Dayanand in forum New To Java
    Replies: 3
    Last Post: 02-23-2011, 06:07 PM
  3. input method help?
    By blazinhieu in forum New To Java
    Replies: 7
    Last Post: 03-12-2010, 03:07 PM
  4. More than one input in one private method
    By rice in forum New To Java
    Replies: 0
    Last Post: 10-02-2009, 05:08 AM
  5. Input parameter of Main method
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 07-12-2008, 06:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •