Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Read double from console without having to read a string and converting it to double.

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    26
    My Mood
    Fine
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Question Read double from console without having to read a string and converting it to double.

    Is there a stream class with a method that would allow reading double value from console without having to read strings (as in BufferedReader, Scanner) and code explicitly to convert it to a double value.
    i.e. Is there a way which doesn't use Double.valueOf(String inputfrmconsole).doubleValue()?


  2. #2
    Junior Member Mrc0d3r's Avatar
    Join Date
    Jun 2011
    Location
    TCP/IP Layer 3
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 6 Times in 5 Posts

    Default Re: Read double from console without having to read a string and converting it to dou

    This should definitely help you.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,360
    Thanks
    56
    Thanked 2,376 Times in 2,346 Posts

    Default Re: Read double from console without having to read a string and converting it to dou

    method that would allow reading double value from console
    Also look at the Scanner class. It has methods to read and convert data.

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    26
    My Mood
    Fine
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: Read double from console without having to read a string and converting it to dou

    Thanks a lot Mrc0d3r and Norm.

Similar Threads

  1. Replies: 1
    Last Post: November 2nd, 2012, 03:21 PM
  2. Reading user input from the console with the Scanner class
    By JavaPF in forum Java SE API Tutorials
    Replies: 3
    Last Post: September 7th, 2011, 04:09 AM
  3. [SOLVED] Read double value from console
    By Lord Voldemort in forum What's Wrong With My Code?
    Replies: 7
    Last Post: June 24th, 2011, 02:15 PM
  4. how to read an integer of DOUBLE datatype with type casting
    By amr in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 14th, 2010, 03:03 PM
  5. string to double
    By wolfgar in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 13th, 2009, 11:47 PM

Tags for this Thread