I need to create a status manager class, tell me if the situation is available.
Tried to do this:
Enter the code here
} Public Class Status Manager {
hashtable current positions = new hashtable (); Zero occupied post (int x, int y) {this.currentPositionsput (new integer ("4"), new integer ("5"); This.currentPositionsput (new integer ("1"), new integer ("5"); This.currentPositionsput (new integer ("11"), new integer ("3"); This.currentPositionsput (new integer (" 42 "), the new integer (" 55 "); This.currentPositionsput (new integer (" 11 "), new integer (" 53 "); set key = this.currentPositions.keySet (); // Setter.teater = keys.Director (); System.out.println ("The map contains the following teams:"); while (keyIter.hasNext ()) {Object key = keyIter.next (); // Next key Obtain object value = this.currentPositions.get (key); // Get the value for the key System.out.println ("(" + key + "," + value + ");}} Public static zero main (string [] args) {New position manager (.) Captured The post (3, 3);}
Of course this is just an exam, which I try to do I am getting it all the same again, it is used again, the problem is that if I can not duplicate the keys, then what kind of data structure should I use? New? Thanks in advance.
No comments:
Post a Comment