Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BufferedWriter Confirmation #89

Open
VishGov opened this issue Dec 15, 2019 · 1 comment
Open

BufferedWriter Confirmation #89

VishGov opened this issue Dec 15, 2019 · 1 comment

Comments

@VishGov
Copy link

VishGov commented Dec 15, 2019

Hi Esteban,

In the BufferedWriter code snippet for chapter 23:

try ( BufferedWriter bw =
new BufferedWriter( new FileWriter("/file.txt") ) ) {
w.newLine("Writing to the file...");
} catch(IOException e) { /** ... */ }

I done think newLine() takes in any input. You can do w.newLine() to add a new line.
To add a string, I think you need to use w.write(String str).

w.write("Writing to the file...");

Could you confirm on this once?

Thanks and Regards,
Vishnu

eh3rrera added a commit that referenced this issue Dec 16, 2019
@eh3rrera
Copy link
Owner

Hi Vishnu,

You're right, I've fixed it. Thank you so much!

eh3rrera added a commit that referenced this issue Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants