Forum: Java Oct 9th, 2009 |
| Replies: 1 Views: 168 For some reason this method prints out an extra integer at the bottom. For example: It is supposed to only print out 4 x4.
20 20 20 20
20 20 20 20
20 20 20 20
20 20 20 20
20
Any idea... |
Forum: Java Oct 8th, 2009 |
| Replies: 8 Views: 413 Thanks everyone. Just needed a little psuedocode to gain some understanding. |
Forum: Java Oct 8th, 2009 |
| Replies: 8 Views: 413 I have read it many times, if I understand all I would not be asking for assistance. If you cannot provide assitance without being rude, I would rather you not respond at all. |
Forum: Java Oct 8th, 2009 |
| Replies: 8 Views: 413 I understand how to get elements from an array. I am working on the display. How to display elements of an array at certain positions. If charA and charB are matches then display the positions of... |
Forum: Java Oct 8th, 2009 |
| Replies: 8 Views: 413 Hi all,
I wondering how to get started with this. I am working on a method that will take two ints. These ints represent positions in an arraylist of characters. I am trying to determine if... |
Forum: Java Oct 4th, 2009 |
| Replies: 7 Views: 296 hmm, I have never heard of an array of Character. Would you provide an example? |
Forum: Java Oct 4th, 2009 |
| Replies: 7 Views: 296 Here is a snippet of code:
Array<Character> letters = new ArrayList<Character>();
char[] characters = new char[row * col];
...
public void createShuffleLetters()
{ |
Forum: Java Oct 4th, 2009 |
| Replies: 7 Views: 296 Hi All,
Is it possible to convert an arraylist of chars to an array? For example:
ArrayList<Character> array = new ArrayList<Character>();
Can this be converted to an array of chars. I... |
Forum: Java Oct 3rd, 2009 |
| Replies: 11 Views: 423 This is great, but how would I go about preventing duplicates when the array is randomized? |
Forum: Java Oct 3rd, 2009 |
| Replies: 11 Views: 423 This was was not working for me.
Here is what I have so far. In stead of printing it out in one row how can i get it to print in both rows and colomns. For example:
A B C D
E F G H
I J K... |
Forum: Java Oct 3rd, 2009 |
| Replies: 11 Views: 423 Hi,
This is a very simple question. Is it possible to print a one dimensional array into the shape of a grid?
For example if I have the follow array:
chars arrayofChars[] = {'A', 'B', 'C',... |
Forum: Java Oct 1st, 2009 |
| Replies: 2 Views: 316 Yes, I think I got it. Thanks |
Forum: Java Oct 1st, 2009 |
| Replies: 2 Views: 316 Hello,
I am working on a plain old simple text version of a memory game.
The player will be able to match letters of the alphabet by clicking on various numbers. For example
This is what the... |
Forum: Java Sep 10th, 2009 |
| Replies: 1 Views: 216 Hi all,
I have a quick question. Is this a proper way of using blackbox testing to test the stringTokenizer class? If not, would you provide a proper example that displays the pass or fail.
... |
Forum: Java Aug 1st, 2009 |
| Replies: 2 Views: 347 Hi,
I really hope that someone can give me a little advice. I am working on a program that reads a text file formatted as follows:
Bike, Schwinn, 45.00
Car, Mercedes, 98,000
...
I am... |
Forum: Java Jul 30th, 2009 |
| Replies: 3 Views: 344 I really hope that someone can provide some suggestions or help to guide me in the right direction.
I am trying to use a scanner to parse a string and use its elements with methods. It is... |
Forum: Java Jul 29th, 2009 |
| Replies: 3 Views: 344 Hello,
I have a text file that is formatted as such:
Volkswagen, 547, 9.78, 2
Mercedes, 985, 45.77, 35
...
I am trying to figure out how use the Scanner to read from the text file and store... |
Forum: Java Jun 6th, 2009 |
| Replies: 10 Views: 2,065 Thanks all, it works fine, but I am curious as to why eclipse gives the error but not JGrasp. |
Forum: Java Jun 4th, 2009 |
| Replies: 10 Views: 2,065 There must be some sort of error in Eclipse, because it is the only one that gives this error. However, I moved over to JGrasp and it works fine with your solution.
Is there any way to add a 0... |
Forum: Java Jun 3rd, 2009 |
| Replies: 10 Views: 2,065 Thanks, I tried that but still get the same error. Any other suggestions? |
Forum: Java Jun 3rd, 2009 |
| Replies: 10 Views: 2,065 Hello all,
I am trying to display time in the following format that represents hours and minutes:
hh:mm
public String getTime()
{
String time = String.format("%tI:%tM",... |
Forum: Java May 25th, 2009 |
| Replies: 2 Views: 388 Hello All,
I really hope that you can help me. I am working on a program that will read a randomaccess file's contents and store the contents into an array. It will then update the array and... |
Forum: Java Apr 24th, 2008 |
| Replies: 1 Views: 1,352 Hi,
I am working on a sort of stack calculator. If anyone can suggest a better method please advice:
Basically, using the stringtokenizer to break the string into tokens. If the token does... |
Forum: Java Apr 17th, 2008 |
| Replies: 11 Views: 1,097 This is the line the received the exception:
hash2.put(info,((Item)hash.get(info)).getDescrip());
Well, "info" is infact a substring from a string entered by the user and getDescrip() returns a... |
Forum: Java Apr 16th, 2008 |
| Replies: 11 Views: 1,097 Thanks Ezzaral,
It worked exactly as you described however I am now receiving the following error that I am trying to figure out:
Exception in thread "main" java.lang.ClassCastException:... |
Forum: Java Apr 16th, 2008 |
| Replies: 11 Views: 1,097 I have tried the following:
if(test.containsKey("mouse"))
{
test2.put("mouse", (test.getDescrip()));
} |
Forum: Java Apr 16th, 2008 |
| Replies: 11 Views: 1,097 No prob JavaAddict,
I started a new thread because the old one started to get a bit confusing and unorganized. I was starting to confuse myself with all of the changes that I was making... |
Forum: Java Apr 16th, 2008 |
| Replies: 11 Views: 1,097 Thanks for your help Ezzaral. |
Forum: Java Apr 15th, 2008 |
| Replies: 11 Views: 1,097 Hello All,
How can I get the information that corresponds with the containsKey to be put into the hashtable.
I am checking to see if a hashtable contains a key. If it does how can I put... |
Forum: Java Apr 14th, 2008 |
| Replies: 3 Views: 791 Just at a glance there are numerous issues. You need to fix the obvious things then resubmit your code within code tags to allow for ease of reading. |
Forum: Java Apr 14th, 2008 |
| Replies: 6 Views: 764 All are type Objects with the exception of "info", which is a String read from user input. Of course hash and hash2 represents the hash tables. |
Forum: Java Apr 13th, 2008 |
| Replies: 6 Views: 764 Well, I have made some progress. But it still will not "remove" the item from the hashtable.
this is how I used the put method:
hash2.put(hash.get(info), hash.getDescrip());
However when... |
Forum: Java Apr 13th, 2008 |
| Replies: 6 Views: 764 The problem has to be with how I am using the put method. When I test the put method with simple strings it works fine. |
Forum: Java Apr 13th, 2008 |
| Replies: 6 Views: 764 How is this? I still have the same problem. It will not go into the hashtable.
for(int i = 0; i < 7; i++)
{
if(hash.containsKey(info))
... |
Forum: Java Apr 13th, 2008 |
| Replies: 6 Views: 764 Hello All,
I really hope that someone can provide some assistance.
I have read a XML file into my hashtable. Next I created a second hashtable. If a key is located in my first hashtable, I... |
Forum: Java Apr 10th, 2008 |
| Replies: 2 Views: 488 Does any one know of any good websites that explain hash tables in great detail?
Thanks |
Forum: Java Mar 28th, 2008 |
| Replies: 1 Views: 1,182 Hello All,
I am using a stringtokenizer to divide a string while comparing each word in the string to a specific word and pushing it onto a stack. I can push it onto the stack with no problems;... |
Forum: Java Mar 16th, 2008 |
| Replies: 3 Views: 1,918 |
Forum: Java Mar 14th, 2008 |
| Replies: 6 Views: 624 |
Forum: Java Mar 14th, 2008 |
| Replies: 6 Views: 624 Thanks for the reply. Are there any real differences between Eclipse and NetBeans? |