Your wording makes me think you have not quite assimilated the difference between a class and a class object (instance). Better read up on the basics.
And anyway that code is wrong - the class...
Type: Posts; User: cbreemer
Your wording makes me think you have not quite assimilated the difference between a class and a class object (instance). Better read up on the basics.
And anyway that code is wrong - the class...
i don't think this code is correct. And regardless, using bitwise operators (&, | etc. ) only really makes sense if you are actually interested in individual bits.
Seems like the assignment here is...
Makes sense. But I vaguely remember, from long ago, that in a class definition you could use
static
{
// arbitrary code here
}
for code to be executed at class load time.
(Assuming this is on Windows) I like to use SysInternals Process Monitor to see where a program looks for its files. It can sometimes be surprising 😀
[EDIT] Oops, I read this is on Ubuntu. Then use...
An alternative title for this post could be "Do my work for me".
Absolutely ! Same here. I think programming (as well as making music, my other hobby) will do wonders for the aging brain.
I learnt Java 25 years ago from David Flanagan's book "JAVA in a nutshell" (published by O'Reilly) and found it eminently useful. Probably very outdated now, but to learn the basics, it might still...
Awesome, that does it. Many thanks !!!
Well spotted by armela.
But why are you passing a and b as parameters to function additionate(), but not to function storeInMap() ? This is so inconsistent. Either pass your variables down to...
No, as explained by Norm. And even if you could, it would be very bad design. Nobody expects a method to have side effects in code outside the method, let alone mess with variables defined on a...
Good tip Norm, thanks. I don't like suppressing warnings, but fixing them all in the code is getting like a huge pain in the butt. And I admit I WAS compiling with -Xlint:unchecked (after a...
If j starts at 5 and the loop condition is j>1 you'll get only 4 iterations (j = 5, 4, 3, 2)
The condition should be j>0 (or j>=1 if you prefer).
Hi all, this is my first post here. After not doing any much Java for 15 years (mostly C and C#) I decided to revisit my old Java projects. I'm using OpenJDK 11.0.12 because Microsoft was kind enough...