Paweł Baczyński

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

Recent posts by Paweł Baczyński

Stephan van Hulst wrote:To further clarify what Paweł wrote, the value you are using to create the BigDecimal instance with is not actually -0.206, but the closest value that can be represented by the double datatype.


And this value is exactly -0.2059999999999999886757251488234032876789569854736328125.
1 month ago
You can find the answer is in the javadoc of the constructor.
It is not a problem with the abs() method. It is a problem with the instance of BigDecimal that you are creating.
1 month ago
It prints 55 because this is the number assigned to character '7' (DIGIT SEVEN).
1 month ago

Tim Holloway wrote:An ArrayList (as far as I know) encapsulates an array (although it could just as easily employ an internal linked list)


So it would become a LinkedList.
1 month ago
Also, there is no sense in using the String constructor. If you want to assign a String to a variable just write:
1 month ago
Make first() return the string.
2 months ago
There are 5 append methods in StringBuilder with one parameter that is a reference. The compiler doesn't know which of these you want to invoke when passing null as this could be any of them.
You can help the compiler by adding a type information to the call:
You are right. It looks like the body of takesAnArray is missing.

The code from the book:
Change the condition in the for loop to i < rund.

The standard idiom to iterate n times is
for (int i = 0; i < n; i++) {  }
2 months ago
I strongly encourage you to change your toString() method so it doesn't collect user input.

Also, can you show your current code?
2 months ago
In your toString() method you are calling name(), time(), bags() and pots() again which results in new input being collected.
2 months ago
I had the same issue. I ended up contacting Oracle Certification Program Team and they resolved the issue.
2 months ago
My suggestion is that there are zero lines <searchTag> in the file. You are using equals so any single white space will cause your filter condition to return false.

Note that you don't have to read the whole file to the list and then create a stream from the list.
You may create a list from the file directly by using Files.lines().
3 months ago