Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

search the word using random characters in java

 
zhetha lakshmi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I created some words using string array like elephant ,apple,telephone ..etc. If i given the input like 'e' 'p' 'h' 't' character one by one means, expect the output is "elephant" and "telephone".

Please guide me.

Thanks & Regards,
seetha
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15284
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, write down in plain English (or your own native human language) what you think the steps are to find the words that you need to find.

You have a list of words, and a list of letters. What is your program going to do with those two to find the words that match?

Once it's clear what the plan is, you can start thinking about writing it down in Java code.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12127
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zhetha lakshmi wrote:Hi,
I created some words using string array like elephant ,apple,telephone ..etc. If i given the input like 'e' 'p' 'h' 't' character one by one means, expect the output is "elephant" and "telephone".

Why would the expected output be "elephant" and "Telephone"? Why would it not include "apple"?

An example like this is a good START, but it is not a "spec" (or specification). The first step in writing code is understanding the problem. The next step is writing out an algorithm for a solution, as Jesper said.

Until you can do that, there is no point in writing a single line of code.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zhetha lakshmi wrote:I created some words using string array like elephant ,apple,telephone ..etc. If i given the input like 'e' 'p' 'h' 't' character one by one means, expect the output is "elephant" and "telephone".

Why?

When you can explain that in detail and in English (or your native language), you will be a long way towards solving your problem.

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic