Results 1 to 13 of 13
  1. #1
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Angry BufferedReader error cannot resolve symbol

    Hey i am 16 and new to java and new to this site

    Anyways i have some errors with the BufferedReader. At school in my computer science class the code compiles nicely and just fine but on my home computer it gives me errors! :mad:

    It says bufferedreader cannot resolve symbol and also the same for system and input

    Any help is appreciated, thanks.

    Java Code:
    import java.io.*;
    public class Temp {
        
        public static void main(String[] args) throws IOException {
        	BufferedReader= new BufferedReader(new FileReader(system.in));
        	int age;
        	System.out.print("Your age is"+" ");
        	age= Integer.parseInt(input.readLine());

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    You've no declare any BufferedReader variable to refer, the following line

    Java Code:
    BufferedReader= new BufferedReader(new FileReader(system.in));
    should be change as

    Java Code:
    BufferedReader input = new BufferedReader(new FileReader(system.in));

  3. #3
    [RaIdEn] is offline Senior Member
    Join Date
    Oct 2009
    Location
    California,US
    Posts
    201
    Rep Power
    5

    Default

    Java Code:
    BufferedReader= new BufferedReader(new FileReader(system.in));
    ok i think you missed something here didnt you?...

    shldnt it be
    Java Code:
    BufferedReader [b]reader[/b]= new BufferedReader(new FileReader(system.in));
    for calling classes the initial letter should be in caps

    Java Code:
    System.in
    where did you decalre input variable?
    Java Code:
    age= Integer.parseInt(input.readLine());

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Posting the complete error message more helpful. If you go through all the errors and read them carefully, it's possible to find the mistake you've done in that code by yourself. Good luck!

  5. #5
    [RaIdEn] is offline Senior Member
    Join Date
    Oct 2009
    Location
    California,US
    Posts
    201
    Rep Power
    5

    Default

    Quote Originally Posted by Eranga View Post
    Posting the complete error message more helpful. If you go through all the errors and read them carefully, it's possible to find the mistake you've done in that code by yourself. Good luck!
    agreed but if you want any assistance with the errors just dont be afraid to ask

  6. #6
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    Thank you i see where i made the mistake now :)

    Thats the thing i have to get used to is looking for little errors like that
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by [RaIdEn] View Post
    agreed but if you want any assistance with the errors just dont be afraid to ask
    Yep, that's why forums like Java Forums are build on, to help each other.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by SwEeTAcTioN View Post
    Thank you i see where i made the mistake now :)

    Thats the thing i have to get used to is looking for little errors like that
    Cool, everyone learn by mistake lol. :)

  9. #9
    [RaIdEn] is offline Senior Member
    Join Date
    Oct 2009
    Location
    California,US
    Posts
    201
    Rep Power
    5

    Default

    Quote Originally Posted by SwEeTAcTioN View Post
    Thank you i see where i made the mistake now :)

    Thats the thing i have to get used to is looking for little errors like that
    dont worry just practice you'll shine :o

  10. #10
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    lol thanks it compiles now

    im sure i will have more questions in the future
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    If you've solve the problem please mark thread solved from the tool menu on top of the thread. It's really helpful to all other members.

  12. #12
    SwEeTAcTioN's Avatar
    SwEeTAcTioN is offline Member
    Join Date
    Oct 2009
    Posts
    69
    Rep Power
    0

    Default

    Aight thanks i marked it
    Are you suggesting that Cocunuts migrate?!! -Monty Python

  13. #13
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Yet another Cannot Resolve Symbol
    By Gabinka in forum New To Java
    Replies: 5
    Last Post: 03-27-2009, 10:28 PM
  2. cannot resolve symbol while using javac
    By andi9 in forum New To Java
    Replies: 5
    Last Post: 05-14-2008, 06:50 AM
  3. Cannot Resolve Symbol error...
    By seral1969 in forum New To Java
    Replies: 4
    Last Post: 02-18-2008, 12:17 AM
  4. Replies: 1
    Last Post: 12-21-2007, 11:12 AM
  5. Error: cannot resolve symbol, help me
    By mathias in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-06-2007, 02:46 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
  •