Paweł Baczyński

+ Follow
since Apr 18, 2013
Paweł likes ...
Firefox Browser IntelliJ IDE Java Linux Spring
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paweł Baczyński


Campbell Ritchie wrote:It's a really good book because you had such good technical editing

And I couldn't agree more.
Maybe the value is a String "null"?
1 month ago
Are you sure that Java 10 is configured?

I can see C:\Program Files (x86)\Java\jdk1.0.0_144 on the screenshot.

Also, please post text not screenshots.

I tried your code on JDK8 and it compiled just fine.
1 month ago
You can read Effective Java Item 1: Consider static factory methods instead of constructors.
1 month ago

This is an anonymous class that extends MyThread and overrides its run() method.
When you start this thread the overriden method is executed and it prints "foo".

This is an anonymous class that extends MyThread and does not override its run() method. The run() method is overloaded instead.
When you start this thread the run() method from MyThread is executed and it prints "Bar".
2 months ago
How are you running this program?
2 months ago
Can you clarify what do you mean by under ID, i want it to code the .txt files and give it a ID?
I don't understand this part.
2 months ago
What should the program do when I type C?
2 months ago
I tried your code and the list was saved to the file.
Are you opening the file for writing later? It would overwrite the file.

By the way, as you are using try-with-resources there is no need to explicitly call flush/close.
2 months ago
For the "c" to continue. You are comparing strings using the equality operator dd == "c". Don't do this.

It would be a good idea to format your code with proper indentation. Also, don't omit braces like you did on lines 35-60 (whole if/else/do/while is confusing to read).

Also, remember that main is a pain.

You may want to split your code into smaller methods.
2 months ago
Welcome to the Ranch!

Please tell the details. What problems do you face?
2 months ago
Averager is not a BiConsumer.

Averager::accept is a method reference that can be replaced with a lambda (averager, value) -> averager.accept(value). This lambda represents a BiConsumer.

The code can be replaced with:
2 months ago