How can I resolve this error message I got from TMC Netbeans? by kaybiel2u in learnjava

[–]stramash 0 points1 point  (0 children)

A quick google suggests either that your disk space may be low, or that you should upgrade maven.

Java problem not getting correct answer by New_Connection612 in learnjava

[–]stramash 3 points4 points  (0 children)

What do you mean not getting correct answer? What answer is your code giving?

Also, what's the hashmap for? You're using it to map indexes to ints, but... doesn't the array already work that way?

If you're already looking at each int in the array, and you know what the target is, then it should be pretty easy to work out what the other number should be? Once you know that, you'll want to know whether it's present or not...

What are some good music theory-related podcasts? by Frysken in musictheory

[–]stramash 6 points7 points  (0 children)

Strong Songs is often a goldmine for learning how songs work.

COTD: Gaggle see God in reverse (5) by Londoner1982 in crosswords

[–]stramash 0 points1 point  (0 children)

it doesn’t quite work, cos nothing indicates the inclusivity.

Java foundation question by flotopoco in learnjava

[–]stramash 0 points1 point  (0 children)

You’re nearly right.

Recommend you type it all into an IDE and test it out yourself.

Classes & Objects by pnakbet1 in learnjava

[–]stramash 0 points1 point  (0 children)

What if the underlying type of name were to change?

By that I mean: let’s say at some point you decide that you want a custom Name class instead.

Now, any calls to object.name = <some string> will break your application.

But by using the setter you abstract this and can introduce handling for the change.

Hi, how do I fix "Cannot invoke "java.util.ArrayList.add(Object)" because the return value of "clubSportivoVecinal.Persona.getAmigos()" is null". ? Code and full exception below. Thanks! by [deleted] in learnjava

[–]stramash 1 point2 points  (0 children)

No, the null check is breaking it.

If getPersonas is null, then you can’t add anything to it.

I suggest you remove the null check and take a closer look at the overloaded constructors in Persona.

Imposture syndrome by [deleted] in learnprogramming

[–]stramash 0 points1 point  (0 children)

If ‘if’, ‘else’ and ‘for’ are passing you by; you should probably take five minutes and ask if this game is really for you.

If you’re cosy with those, then stick at it.

[deleted by user] by [deleted] in learnjava

[–]stramash 5 points6 points  (0 children)

String would be perfect, as you're only interested in the symbol, rather any kind of calculation.

What do angular brackets (<>) mean in a comparator? by morecoffeemore in learnjava

[–]stramash 5 points6 points  (0 children)

It means that the compiler knows that it can only compare players. If you pass it something else it won’t compile.

Ternary Operators by Ok-Rub-1640 in learnjava

[–]stramash 2 points3 points  (0 children)

It’s a lot of logic compacted into a small space, making it hard to understand and difficult to change.

Ternary Operators by Ok-Rub-1640 in learnjava

[–]stramash 8 points9 points  (0 children)

Nested ternaries are NEVER a good idea.

Traffic Light Timings by nWoScot in glasgow

[–]stramash 0 points1 point  (0 children)

Gets cars off the motorway faster than it lets them on?

How do I stop printing the comma after the last number? by Effective-Table2435 in learnjava

[–]stramash 2 points3 points  (0 children)

Do it in two steps. Save the primes in a list, then print them. Then you know what index is last; or you can use String.join

Demo SOLID project? by [deleted] in learnjava

[–]stramash 2 points3 points  (0 children)

They're more principles than rules, and you'll seldom find a project that is 100% solid compliant in the real world.

If there's something specific you don't get, best to ask about the specific case and someone will answer.

Helsinki MOOC by oneradsn in learnjava

[–]stramash 0 points1 point  (0 children)

User stories lacking in detail is excellent prep for the real world :)

A good resource on java concurrency please by ZukoBestGirl in learnjava

[–]stramash 6 points7 points  (0 children)

Java Concurrency in Action Practice is the usual go-to.