Win a copy of Securing DevOps this week in the Security forum!

Paweł Baczyński

Bartender
+ Follow
since Apr 18, 2013
Paweł likes ...
Firefox Browser IntelliJ IDE Java Linux Spring
Forum Moderator
Paweł Baczyński currently moderates these forums:
Kraków
Cows and Likes
Cows
Total received
44
In last 30 days
0
Total given
58
Likes
Total received
479
Received in last 30 days
2
Total given
617
Given in last 30 days
25
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paweł Baczyński


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".
6 days ago
How are you running this program?
6 days 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.
1 week ago
What should the program do when I type C?
1 week 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.
1 week 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.
3 weeks ago
Welcome to the Ranch!

Please tell the details. What problems do you face?
3 weeks 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:
Type inference can't be used for anonymous classes (in Java 8).
You need to write:

Also, this predicate can be replaced with a lambda.
3 weeks ago
The expression new type[runners] is of type type[].
You can't assign it to int variable.
You need a type[] variable.
1 month ago
Look for all places where you create an instance of ClientV1. Make sure you create an instance only once. When you see the second occurrence of new ClientV1 think whether you could use the instance you already have.
1 month ago
I tried running your code and, as I said, pisarz was null.
It was null because you have never called konfigurujKomunikacje on the visible instance of ClientV1.
Note that you are creating two instances. One gets konfigurujKomunikacje called and the other is made visible.
You need to make sure you operate only on a single instance of the client.
1 month ago
Add System.out.println(pisarz) as the first statement of of przyciskWyslijActionPerformed method and check the output.

Did you change something in the code?
It was ClientV1.java:110 previously but it is now ClientV1.java:111.
1 month ago