Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Hashtable find value by key Java Android example

Hashtable find value by key Java Android basic example.


import java.util.Hashtable;

public class MainClass {
	public static void main(String[] arg) {
		
		// english;germany dictionary
		String[] arrayOfString = { "one;eine", "two;zwei", "three;drei" };

	    Hashtable hashTable = new Hashtable();
	    for(String s: arrayOfString){
	    	String[] array = s.split(";");
	    	String sKey ="", sValue="";
	    	if(array.length > 1){
	    	sKey = array[0]; sValue = array[1];
	    		hashTable.put(sKey, sValue);
	    	}
	    }

       // check if key exists 	    
	   if( hashTable.containsKey("two")){
		System.out.print("two = " + hashTable.get("two"));
	   }
	    
	}
}
/*
two = zwei
 */

396LW NO topic_id




AD

Další témata ....(Topics)


285

Eclipse - Workspace in use or cannot be created chose a different one | eclipse-workspace-in-use-or-cannot-be-created-chose-a-different-one


Open your workspace folder and subfolder .metadata:
C:\Users\workspace\.metadata\

Delete .lock file
269

How to Add Home Screen Widgets on Your Android Phone | how-to-add-home-screen-widgets-on-your-android-phone


Long press by finger on screen
From dialogue select Widgets
Select your widget
Put your widget on the screen

Video tutorial - to add home screen widgets - Android 2.1