Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 27th, 2005, 05:43 PM
amoo3 amoo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 363 amoo3 User rank is Private First Class (20 - 50 Reputation Level)amoo3 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 2 h 37 m 38 sec
Reputation Power: 5
dictionary

i wanted to create a java based dictionary type program where the user will input a word and the dictionary will look it up. how would you tell the program

Code:
if (inputword == any word in database) 
{
System.out.println(definition)
}
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #2  
Old March 27th, 2005, 05:58 PM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,424 bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 13 h 54 m 22 sec
Reputation Power: 527
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
I would create a HashMap

Reply With Quote
  #3  
Old March 27th, 2005, 09:57 PM
amoo3 amoo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 363 amoo3 User rank is Private First Class (20 - 50 Reputation Level)amoo3 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 2 h 37 m 38 sec
Reputation Power: 5
um.. how exactly would u use this....

Reply With Quote
  #4  
Old March 27th, 2005, 09:58 PM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,424 bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 13 h 54 m 22 sec
Reputation Power: 527
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
Look in the javadocs

Reply With Quote
  #5  
Old March 27th, 2005, 10:16 PM
amoo3 amoo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 363 amoo3 User rank is Private First Class (20 - 50 Reputation Level)amoo3 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 2 h 37 m 38 sec
Reputation Power: 5
well so far i have this... its not much but its a start.. i guess
right now i just need help on reading input.. words input not integers

Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class dictionary
{
    public static void mian(String[] args){
        try
		{
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));


			String hi = "Used to express greeting. See Regional Note at hey.";
            String bye = "Used to express farewell.";
            try
			{
               	String input = reader.readLine();

                if(input == "hi")
                {
                    System.out.println(hi);
                }


            }
			catch (NumberFormatException nfe)
			{
               	System.out.println("You didn't enter a number");
            }

         reader.close();
      	} catch (IOException ie)
		{
         System.out.println(ie);
      	}
    }
}


i get this error when trying to run it


Code:
C:\j2sdk1.4.2_07\bin\java -Didea.launcher.port=7532 -Didea.launcher.library=C:\IntelliJ-IDEA-4.5\bin\breakgen.dll -Dfile.encoding=windows-1252 -classpath C:\j2sdk1.4.2_07\jre\lib\charsets.jar;C:\j2sdk1.4.2_07\jre\lib\jce.jar;C:\j2sdk1.4.2_07\jre\lib\jsse  .jar;C:\j2sdk1.4.2_07\jre\lib\plugin.jar;C:\j2sdk1.4.2_07\jre\lib\rt.jar;C:\j2sdk1.4.2_07\jre\lib\su  nrsasign.jar;C:\j2sdk1.4.2_07\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_07\jre\lib\ext\ldapsec.jar;C:\j2sd  k1.4.2_07\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_07\jre\lib\ext\sunjce_provider.jar;C:\java\classe  s;C:\IntelliJ-IDEA-4.5\lib\idea_rt.jar com.intellij.rt.execution.application.AppMain dictionary
java.lang.NoSuchMethodException: dictionary.main([Ljava.lang.String;)
	at java.lang.Class.getMethod(Class.java:986)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:75)
Exception in thread "main" 
Process finished with exit code 1

thanks

Reply With Quote
  #6  
Old March 27th, 2005, 10:20 PM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,424 bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level)bullet User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 13 h 54 m 22 sec
Reputation Power: 527
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
You've misspelled the method name.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > dictionary


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT