java - multiple fields in HashTable -


I want to make a hashable in the Java program. There must be several fields in the hashtable (I now want to store 3 columns which I have read with DB). How many columns can I store such as hashtable stores key value success? I would like to keep the first column in the form of a key and the third column as value. Please help!! Thanks!

First of all, you need a new class that can store values:

  public class values ​​{public final string foo; Public Finals Long Bar; Public Finale Long Fowar; Public value (final string fu, final long bar, final long furor) {this.foo = foo; This.bar = bar; This.foobar = foobar; }}   

You can make your hashtable (Do you really need thread protection?) Like this:

 < Code> Last Maps & lt; String, value & gt; Container = New Hashtable & lt; String, value & gt; ();   

If you do not need thread protection, you can use hashmap instead.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -