Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!

Liutauras Vilda

Sheriff
+ Follow
since Nov 12, 2014
Liutauras likes ...
Mac OS X VI Editor BSD Linux
Forum Moderator
Liutauras Vilda currently moderates these forums:
London, United Kingdom
Cows and Likes
Cows
Total received
548
In last 30 days
0
Total given
1876
Likes
Total received
1684
Received in last 30 days
2
Total given
1966
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt

Recent posts by Liutauras Vilda

Welcome to the Ranch! .. and have a good time here.
1 week ago
Seconding ludoviko azuaje.
1 week ago

Stephen Potter wrote:// variables
String name;
String make;


What is the difference between the name and make in this context?

Please avoid writing such comments, which tell nothing extra for the reader of your code, but just clutter the code.

Why did you define those setName(), setMake() methods? Is car's make meant to change after the car is built (via constructor)? Remove all those and you'll see how your class will get more concise an simpler to cope with in your head, simply because it will have only what it has to have and nothing else.

In addition to Campbell's advice to make fields/variables private, make them final as well, that way you'll ensure they won't change their values over the time. That not only decreases errors, but also increases readability of the code, because knowing variable can't change its value, is much easier to read the code and concentrate on the things which may change their value.
2 weeks ago
Tiago Rodrigues Antao, welcome to the Ranch, and have a great week!
4 weeks ago
Here is how code would look using code tags.

And don't question my class, it's an ok
1 month ago
Welcome to the Ranch again!

You did not tell yet what help do you need?

When you post code again, please use code tags, so the code gets rendered as it should be.
1 month ago
Very nice!

Thanks Devaka and all involved.
1 month ago

Andrew Fielden wrote:I get hired at a senior level because of my years of experience and age.


Think of it, that companies don't just hire at a senior level for nothing, and rest assured, don't pay money just for nothing. Their primary goal is business and what is best for them.

While the seniority level is not necessarily something what can be consumed immediately when the person is hired, but most companies at some point (and not singular) in their lifespan have situations, where seniors are the reasons those companies aren't gone already. And I presume it is worth paying the premium only for such an insurance.

Other, more quickly observable things, that work just goes smoother when there is someone senior you can feel near by, not necessarily there is a new tech on offer to learn from, but rather valuable discussions you can have about, whether it be just a chat about the principles one may want to follow or acquire the points you may slip on.

1 month ago
Wish you to have a great week here.
1 month ago

Mark Raphael Qt wrote:

Dave Tolls wrote:What do you think the replace method call does?
The documentation might help you:
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#replace(char,char)



Its more complicated than that, or I would not have asked. Does anyone have the patience please to explain why the two different String objects are not modified using the replace method please?


Did you take time to read what Dave Tolls showed you? I think you should be able to assemble the reasoning.

Some hints:
1. Strings are immutable
2. Return result not being stored anywhere

One could argue they are answers actually.
Hello.

You may want to explain the problem a bit more. You mentioned you have a trouble updating the table for what it seems, however, that was it. It may be hard for somebody to help you - there could be many troubles.
1 month ago
PHP
Hi Jesse,

No, you done nothing wrong. The thread has been suspended for other reasons, think of it, some other user did not comply with posting standards.
That thread may or may not go back to public at some point if user fixes mistakes.

Please have a cow for your hard efforts in that thread.
1 month ago

Krystian Wie wrote:You declare array Popcorn and method? How?


Nope, that method supposed to return a Popcorn array of particular length.
2 months ago

Paul Clapham wrote:No, really, a perfect hash function can only be constructed if you know all of the keys in advance. Then the function is constructed so that it maps each of the N keys to each of a set of N distinct integers.


Oh I see, I slightly misread what was said there. My apologies. I understood it as "... but if the hash function was well implemented..", although I haven't heard this term for a while and forgot so couldn't re-assemble an actual thought.

Campbell Ritchie wrote:I thought put() runs in amortised constant time.


But that would be an average, right? Which I'd agree is correct.
2 months ago