Search:

Type: Posts; User: cbreemer

Search: Search took 0.08 seconds.

  1. Re: What language would describe this code so that I can research it?

    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...
  2. Replies
    2
    Views
    673

    Re: Help me to figure out how code working

    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...
  3. Re: Tutorials code not working with variables and arrays

    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.
  4. [SOLVED] Re: Cannot load file from resource using getClass().getResource

    (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...
  5. Replies
    3
    Views
    831

    Re: Solve my problem

    An alternative title for this post could be "Do my work for me".
  6. Re: Old programmers never die, they just become object oriented. (?)

    Absolutely ! Same here. I think programming (as well as making music, my other hobby) will do wonders for the aging brain.
  7. Replies
    2
    Views
    2,411

    Re: Struggling with Java :o

    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...
  8. Replies
    4
    Views
    719

    [SOLVED] Re: Struggling with generics

    Awesome, that does it. Many thanks !!!
  9. Replies
    2
    Views
    648

    Re: Var ends up being 0

    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...
  10. Replies
    4
    Views
    1,637

    Re: Are method parameters two way traffic?

    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...
  11. Replies
    4
    Views
    719

    [SOLVED] Re: Struggling with generics

    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...
  12. Re: Why is this nested for loop not printing 5 spaces on the top line?

    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).
  13. Replies
    4
    Views
    719

    [SOLVED] Struggling with generics

    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...
Results 1 to 13 of 13