I'm new to CinReader. I've imported it and everything, but I'm lost on how to use it.
It says cannot find symbol- method nextLine();
This is how I did it with the scanner and it worked fine.
What am I doing wrong with CinReader
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.
I'm new to CinReader. I've imported it and everything, but I'm lost on how to use it.
It says cannot find symbol- method nextLine();
This is how I did it with the scanner and it worked fine.
What am I doing wrong with CinReader
Last edited by DarkestLord; March 11th, 2014 at 04:02 PM.
Please edit your post and wrap your code with code tags:
[code=java]
YOUR CODE HERE
[/code]
to get highlighting and preserve formatting.
What package is CinReader in? Is there some API doc for it? If so, have you read it?
If you don't understand my answer, don't ignore it, ask a question.
Mmmm...not sure what you mean by "package". I just downloaded it and I can use it for integers just fine, but I haven't been able to type words into it.
Last edited by DarkestLord; March 11th, 2014 at 04:15 PM.
Take a look at the CinReader API docs at Generated Documentation (Untitled). CinReader does not have a nextLine method.
Since the API docs are devoid of examples, here's one showing how you would use it to get an integer input:
public static void main(String[] args) { CinReader reader = new CinReader(); System.out.println("Enter integer: "); int response = reader.readInt(); System.out.println("response: " + response); }
As for the code to read String values, well, that's the exercise for you. :-)