java - how to create class that adds, deletes and find words in a dictionary? -


this have , i'm new java:

 import java.util.*;   public class wordpairs  {       // arraylist<string> names = new arraylist<string>();      // arraylist<string> meanings = new arraylist<string>();      //names.add("empty");      //meanings.add("empty");       string searchname;      string searchmeaning;         string names[] = new string[25];         string meanings[] = new string[25];         int q = 1;     public void setwordadd(string name,string meaning)    {    names[q] = name;      meanings[q] = meaning;      q = q++;   }    public void setworddelete(string name)    {      for(int i=0;i<names.length;i++)      {         string check =  names[i];         if(check == name)         {              string meanings = meanings.remove(i);         }      }   }    public void setwordsearch(string name)    {      int = 1;       for(i=0;i<names.size();i++)      {         string check = names.get(i);          if(check == name)         {            searchname = names.get(i);            searchmeaning = meanings.get(i);             = 0;         }      }       if(a == 1)      {         searchname = "word can not found";         searchmeaning = "meaning can not found";      }   }     public string getsearchname()   {      return searchname;   }    public string getsearchmeaning()   {      return searchmeaning;    } } 

http://download.oracle.com/javase/1.4.2/docs/api/java/util/hashmap.html


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -