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
61
Likes
Total received
492
Received in last 30 days
4
Total given
650
Given in last 30 days
9
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paweł Baczyński

Make first() return the string.
1 week 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++) {  }
4 weeks ago
I strongly encourage you to change your toString() method so it doesn't collect user input.

Also, can you show your current code?
4 weeks ago
In your toString() method you are calling name(), time(), bags() and pots() again which results in new input being collected.
4 weeks ago
I had the same issue. I ended up contacting Oracle Certification Program Team and they resolved the issue.
4 weeks 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().
1 month ago
Of course it is.
If thread a calls b.join() and thread b calls a.join() they will both wait for each other.

There is even simpler case. Try calling Thread.currentThread().join() and see what happens.
Welcome to the Ranch!

You will find the answer here: https://coderanch.com/wiki/659740/create-Java-program
1 month ago
Welcome to the Ranch!

What question do you have? What do you need to be explained?
1 month ago
How are you compiling the classes (what command)? How are you running them? What is the directory you compile/run them from? (type cd in the console).
1 month ago

jose laguia wrote:your wrote

Line 3 prints true because runtimeException is an instance of class Exception.....


And then I wrote (...) or a subclass of Exception.

You wrote:This is technically correct (the best kind of correct ).

But, your confusion with the super-/subclass comes from the fact that you wrote the relation between classes inversely.
Write this as below and everything should be clear:


jose laguia wrote:Maybe you are confusing variables with objects.


I am not. When I wrote  runtimeException is an instance of class Exception what I meant was an object referenced by the variable named runtimeException is an instance of class Exception.