-
October 13th, 2011, 06:00 PM
#1
[RESOLVED] I am confused..
I am trying this:
Code:
try(BufferedReader br = new BufferedReader(new FileReader("T.txt")); BufferedWriter bw = new
BufferedWriter(new FileWriter("T.txt"))) {
read = br.readLine();
ArrayList ara = new ArrayList();
do {
br.readLine();
ara.add(read);
}while(br.hasRemaining());
Error:
Code:
Test2.java:70: error: cannot find symbol
}while(br.hasRemaining());
^
symbol: method hasRemaining()
location: variable br of type BufferedReader
1 error
complete!
Press any key to continue . . .
What am I doing wrong I've even imported the Buffer API package. I would really appriciate a nice apt explaination of what exactly the "." operator does. Because, I don't fully understand it. Or if you can explain it here. *edit* I suppose I understand that br.hasRemaining doesn't work, because bufferedReader doesn't have a hasRemaining method. I would still like a nice explainatoin of the "." operator.
Last edited by kolt007; October 13th, 2011 at 06:11 PM.
-
October 14th, 2011, 10:36 AM
#2
Re: I am confused..
Read the API for BufferedReader. There is no hasRemaining() method.
-
October 15th, 2011, 07:11 AM
#3
Re: I am confused..
I would still like a nice explainatoin of the "." operator
You can think of it as meaning the method or variable that is in the preceding class or object. ie
Code:
System.out.println("SomeText");
means the method called 'println' that is in the object referenced by the 'out' variable that is in the class 'System'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|