Quote Originally Posted by Blodrast
If you mean: "Can I make a class that I only ever instantiate once ?", then the answer is most definitely yes.
Now, we might be getting into murky territory (or maybe we're already there :D), and I honestly don't know the scope of your assignment, BUT, here's an idea. It may be totally off, since, again, I don't know if using design patterns is or is not an issue for your assignment.
From what I remember from design patterns (which is admittedly not much), one of the classical design patterns is the Singleton - which ensures that only one instance of some class exists throughout the duration of the program.
I'm mentioning this because, IF you are supposed to use design patterns, this may be a good candidate for a Singleton.
If you're not dealing with design patterns at all, then ignore this.
I'll look into this if I have the time



Well, ok, then I guess you can just use BigInteger, which you already have implemented, I guess.
It's a standard java class.

Or, does it not have fixed storage ? Can't you ask him whether he is ok with something "large enough" (i.e., 2 ^^32, or 2^^64, etc), or does he want something that can potentially increase to accomodate numbers as large as one may desire ?
Because I sense a contradiction here: if you want _fixed_ storage, then it can't increase, so whether it's a simple integer or some intricate crap that allows you to store numbers up to 2^xxxxxxx, but no larger than that, it's a technicality.
But if you want to accomodate potentially ANY number, that can't be done with a fixed storage - you'd need a class that increases keeps adding storage until you can accomodate whatever large number you want.
So, I'm a bit confused (yet again).
My thoughts exactly.


Ok, you don't have to use hashmaps. You could use a sorted array. First element would be lightest, last element would be the heaviest one. Since it's an array, well, you have O(1) access. You can also satisfy the O(log n) sorting requirement by using quicksort.
I'll look into it, I'm was now thinking of using a binary search tree, which should also satisfy the requirements.

Ok, if you only started java 10 weeks ago, then I congratulate you, you're doing very very well. Honestly.
I think so too

Btw, if you want, you can point me to the assignment text, and I'll try to take a look at it (time permitting), see if I can make more sense out of it. But really, you should ask the prof/instructor to clarify all these little things - 'cause they may well grade you on them...
It's only available in Dutch unfortuantly, i've alrady sent 2 emails with questions, the general reply is "if it sin't specified in the assignment, you can do whatever you like, we'll grade you on the result".

Please take all my opinions with a grain of salt, since I'm by no means a Java expert or anything, and I also don't know the exact level of detail/techniques that your assignments are supposed to fit in. I also don't even know what kind of class this is - believe me, it makes a difference whether it is a Programming 101 class, or Data Structures, or Programming Techniques and Algorithms, or the focus is on Complexity, etc, etc.
Object Oriented Programming, it's the second java class for most people who take it iirc. The focus is mainly on using the elements of OOP, such as references, overrides, static and non static variables, instance variables etc.


I think you get my point - depending on which of these is the case, the focus of the assignments will be on completely different things.
Honestly, I have little idea what the focus is on, they really like well documented code though, which means I spend more time writing the docs than writing the code

Anyway, best of luck from now on as well. If any of my drivel turns out to be any help at all, I'll be happy.
Thanks for the help
I'll look into a few things and see what I can do with them, of course, my time is limited so i'll just do what can be done