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

Thread: Why br.readLine() method does not work properly while using it after br.read() method...I am giving the code. Plz help me..

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Why br.readLine() method does not work properly while using it after br.read() method...I am giving the code. Plz help me..

    import java.io.*;
    class NotWrking
    {
    public static void main(String args[]) throws IOException
    {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter the charecter: ");
    int a=br.read();
    System.out.println("Enter the string: ");
    String str=br.readLine();
    System.out.println(str);
    System.out.println("\n"+(char) a);
    }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Why br.readLine() method does not work properly while using it after br.read() method...I am giving the code. Plz help me..

    does not work properly
    Please explain what the code does that is "not proper"?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. getScreenSize() method giving java.awt.HeadlessException
    By tejz123 in forum AWT / Java Swing
    Replies: 1
    Last Post: April 15th, 2012, 06:37 AM
  2. JAVA Programming ReadLine() method
    By AsySyah in forum Java Theory & Questions
    Replies: 1
    Last Post: June 8th, 2011, 09:55 AM
  3. [SOLVED] cannot get this method to work properly
    By Nismoz3255 in forum Loops & Control Statements
    Replies: 2
    Last Post: May 2nd, 2011, 12:00 PM
  4. Help with method plz..
    By whattheeff in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 6th, 2011, 07:27 AM
  5. (.readLine() method) of BufferedReader class
    By chronoz13 in forum File I/O & Other I/O Streams
    Replies: 7
    Last Post: October 13th, 2009, 06:59 PM