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 3 of 3

Thread: unable to raed a string plze help me

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default unable to raed a string plze help me

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;

    class Inpt
    {
    public static void main (String args []) {
    BufferedReader br = new BufferedReader( new InputStreamReader(System.in));
    try {
    System.out.println("enter the char");

    char ch = (char) br.read();
    System.out.println("enter the name");
    String name = br.readLine();
    System.out.println("enter the number");
    int i = Integer.parseInt(br.readLine());
    System.out.println("enter the float value");

    float f = Float.parseFloat(br.readLine());
    System.out.println("double value");
    double d = Double.parseDouble(br.readLine());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }



    }
    }
    Last edited by raju; March 24th, 2012 at 08:45 AM. Reason: it is not taking string value


  2. #2
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    661
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Re: unable to raed a string plze help me

    If you can't be bothered to type out your questions, no one is going to be bothered to help you.
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code

  3. #3
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: unable to raed a string plze help me

    it is not taking string value
    What does this mean? Specifically could you describe what you do when you run this program (ie what you enter at the console - including the "enter" character)? And also *both* the observed behaviour of your program and the behaviour you expected or intended to see.
    Last edited by pbrockway2; March 24th, 2012 at 06:37 PM.

Similar Threads

  1. Unable to view date
    By Rajiv in forum Web Frameworks
    Replies: 1
    Last Post: August 17th, 2011, 09:03 AM
  2. unable to get values for modification
    By javaking in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: September 17th, 2010, 05:27 AM
  3. unable to get the o/p for xml file
    By javaking in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: April 11th, 2010, 11:59 PM
  4. unable to run log code
    By javaking in forum What's Wrong With My Code?
    Replies: 10
    Last Post: April 6th, 2010, 11:49 PM
  5. Unable to sendViaPost to url
    By mousumi in forum Java Networking
    Replies: 2
    Last Post: January 28th, 2010, 04:52 AM