Hash table is an idea of a data structure. HashTable and HashMap as they are known in java are both hash tables. You can pass in an initial capacity and load factor into both of them. The only...
Type: Posts; User: Chris.Brown.SPE
Hash table is an idea of a data structure. HashTable and HashMap as they are known in java are both hash tables. You can pass in an initial capacity and load factor into both of them. The only...
The point of a hash table is to make looking for objects faster because they are put into buckets. I think i have a decent analogy that may help.
Imagine you have a huge bin of...
Complete shenanigans! I've been a software engineer for 6 years and have never coded via command line. And furthermore, learning an IDE like Eclipse is crazy easy, there are many tutorials on the...
Are these static methods or instance methods? Is your array global or being passed from one method to the other? Hard to determine what you are doing without seeing the code or an error.
If this is correct then your end sorted result is going to be an array with every value 1 to 10,000. Creating actual random numbers would take a long long time for this program to run. Perhaps this...
If you have the option that a member may not play a sport then you may want to add a check to make sure the data contains a 4th element before referencing it. This would be a good way to have your...
Just ran your code in Eclipse and it worked perfect. What online compiler are you using and what kind of errors are you getting?
I'm not sure where you're going with this. It seems like you have a good start on it in your gcd method. You mention putting it in the setter methods or the constructor, what are you really trying to...
Seems to me like you would just need to randomly generate your question values then you would have to code your solution so it knows what the answer is.
For your example, get a random number...
There's a difference between request attributes and session attributes. Notice when you save your variable you are doing request.setAttribute() but when you get it back you call...
Duplicate Post http://www.javaprogrammingforums.com/whats-wrong-my-code/28124-how-pass-arraylist-form-servelet-jsp.html
Your problem is tha tyou cant switch on an array itself. You mention that the value of ven[4] is a single char and that is what you want to switch on. You have a couple options, take a look at them...
Are you able to make the part of the method you need into a static method? I'm pretty sure you can call static methods all you want from a JSP, but for instance methods you would need an instance of...
Congrats you call them all methods. A function returns something, a procedure does not (aka a method that returns void). Some people just cant let go of the C++ and ADA terminology. Please forgive me...
You've shown a fairly high level of competence already so i'll give it to you. But i would hope that you take the time to understand what i've done and learn from it.
private void...
Your milligrams function is inside of your main function, move it outside of the function. You can still call it from inside the main function, you just cant define it inside the main function.
The problem is on line tablesize7.add((Hashable)start); "start" is an int so it cannot be cast to "Hashable".
--- Update ---
It seems to me like you're using your interface incorrectly. Your...
Duplicate Post http://www.javaprogrammingforums.com/whats-wrong-my-code/27459-declare-pulic-class.html#post107945
A factorial is simply the number multiplied by all numbers previous to it.
8! = 8*7*6*5*4*3*2*1 or 1*2*3*4*5*6*7*8
Looks like a simple for loop to me. Google "iterative factorial algorithm" if...
I believe i answered this in your thread http://www.javaprogrammingforums.com/whats-wrong-my-code/27503-rational-program-calling-up-different-file-but-same-package.html. Same issue, you're calling...
To call a static method you have to use the classes name before it.
Rational.negate();
If that doesnt fix your problem, could you repost the class your main method is in? It is hard to test...
When you create your board which is a char[][], each element is empty which causes problems. To initialize the array, write a function that goes through each element and sets it to your EMPTY value....
Ok, so you're trying to write an iterative (non-recursive) factorial program. If you have the iterative factorial algorithm, which part is causing you problems? Or do you not have an iterative...
Look at any book with "cookbook" in the title. These have a collections of common problems encountered in the language the book refers to and how to fix them.
Are you looking for specific...
Duplicate post http://www.javaprogrammingforums.com/collections-generics/27455-array-counter-loop.html#post107942