private static setter method problem
Hi there, I'm working on my assignment for uni and I'm having a few problems with one of the questions.
So I'm trying to set the class variable currentLeader to an object of the LongJumper class, it should be null on first run.
then after the first jumper goes he should be set as the currentLeader, which I think I have under control but it's all coming unstuck when I try to use the private setter.
/*class variables */
private static LongJumper currentLeader;
Which is called by this..
* A private class setter method for the class variable currentLeader
private static void setCurrentLeader(LongJumper aJumper)
LongJumper.currentLeader = aJumper;
It complies ok, but when I run the program the currentLeader always stays null. I'd really appreciate it if someone would be kind enough to offer me a few pointers on where I'm going wrong this, as I've pretty much run out of ideas and my course work doesn't seem to have included this type of scenario.
if (LongJumper.getCurrentLeader()== null)