Results 1 to 5 of 5
  1. #1
    chyeeqi is offline Member
    Join Date
    Aug 2009
    Posts
    23
    Rep Power
    0

    Default how can i make bufferedreader

    i wanuse bufferedreader to read string from user in my source code????
    i wan user to key in all te related information...how can i do it????
    Java Code:
    class Customer
    	{
    		private String CustID;
    		private String CustName;
    		private String CustAddress;
    		private String CustContact;
    		private String CustnAge;
    		private String CustOrderNumber;
    		private String CustGender;
    		
    		public void setCustID(String CID)
    		{CustID=CID;}
    		
    		public void setCustName(String NM)
    		{CustName=NM;}
    		
    		public void setCustAddress(String ADDS)
    		{CustAddress=ADDS;}
    		
    		public void setCustContact(String CT)
    		{CustContact=CT;}
    		
    		public void setCustOrderNumber(String ORNO)
    		{CustOrderNumber=ORNO;}
    		
    		public void setCustGender(String G)
    		{CustGender=G;}
    		
    		public String getCustID()
    		{return CustID;}
    		
    		public String getCustName()
    		{return CustName;}
    		 
    		public String getCustAddress()
    		{return CustAddress;}
    		
    		public String getCustContact()
    		{return CustContact;}
    		
    		public String getCustOrderNumber()
    		{return CustOrderNumber;}
    		
    		public String getCustGender()
    		{return CustGender;}		
    	
    	}

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    808
    Rep Power
    6

    Post

    Hi,
    InputStream is = new InputStream ( System.in ) ;
    InputStreamReader isr = new InputStreamReader ( is ) ;

    java.io.BufferedReader br = new java.io.BufferedReader ( isr ) ;

    //get the customerName
    String custName = br.readLine ( ) ;

    -Regards
    Ramya
    Ramya:cool:

  3. #3
    chyeeqi is offline Member
    Join Date
    Aug 2009
    Posts
    23
    Rep Power
    0

    Default

    when i add

    Custname=br.readLine();

    it show me a error message <identifier> expected


    & when i add

    System.out.println("abc");

    to tell the user to key in the data

    it show 2 error

    <identifier> expected

    &

    illegal start of type



    how can i solve them???

  4. #4
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    808
    Rep Power
    6

    Default

    Please try from your end and still if u get problems,i will guide you.

    In the learning stage u need to try hard.
    Last edited by RamyaSivakanth; 08-21-2009 at 03:12 PM.
    Ramya:cool:

  5. #5
    chyeeqi is offline Member
    Join Date
    Aug 2009
    Posts
    23
    Rep Power
    0

Similar Threads

  1. How to use BufferedReader?
    By ProgramBeginner in forum New To Java
    Replies: 4
    Last Post: 10-11-2011, 02:56 PM
  2. Problems with BufferedReader
    By testarosa in forum Advanced Java
    Replies: 2
    Last Post: 03-26-2009, 05:09 PM
  3. BufferedReader
    By vidhya.sk in forum New To Java
    Replies: 2
    Last Post: 09-18-2008, 01:57 PM
  4. Help with BufferedReader in java
    By carl in forum New To Java
    Replies: 2
    Last Post: 07-31-2007, 07:20 AM
  5. BufferedReader empty
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 06:52 PM

Posting Permissions

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