Threads Program

  • Follow


Hello friends,                        I am new to Java and I need your help in doingthese thread programs1) Create 2 threads. First thread provides a string to the secondwhich checks whether the given string is a palindrome or not.2) Write an applet program which has 2 buttons called increase anddecrease on the system thread. The child thread should display a linenumbers from 1 to 30 and back to 1 displaying different positions.When the increase button is clicked, the sleep thead increase and anaction on the decrease button should decrease the sleep time of thethread.Looking forward to your suggestionsTHanksNish
0
Reply nishant.friend (14) 4/1/2007 3:38:17 AM

On Apr 1, 1:38 pm, "nish" <nishant.fri...@gmail.com> wrote:> Hello friends,My friends would not multi-post.<http://www.physci.org/codes/javafaq.html#xpost>(X-post to c.l.j.p./g., w/ f-u to c.l.j.g. only)Andrew T.
0
Reply Andrew 4/1/2007 6:44:35 AM


My primary motivation for replying to this thread(and perhaps the only 
one) is my weird interest in palindromes...
I probably can't help you much directly, as I've been out of Java for 
awhile and only now just trying to get back into this wonderful 
programming language, ... but at least this gives me the opportunity to 
show off some of my own palindromes you might try on your program, 
if/when you get it working.

> Hello friends,
>                         I am new to Java and I need your help in doing
> these thread programs
> 
> 1) Create 2 threads. First thread provides a string to the second
> which checks whether the given string is a palindrome or not.
> 
O.K. So your "these thread programs" provide the performance you 
perceive as necessary to a search for palindromes?  I could only 
understand such an undertaking as an academic exercise, which I presume 
it is.
> 2) Write an applet program which has 2 buttons called increase and
> decrease on the system thread. The child thread should display a line
> numbers from 1 to 30 and back to 1 displaying different positions.
> When the increase button is clicked, the sleep thead increase and an
> action on the decrease button should decrease the sleep time of the
> thread.
> 

O.K.., if I understand you correctly...  I'm hardly an expert on 
threads, nor on Java in general for that matter, but it seems unlikely 
to me that some thread you spawned in your program could influence the 
main thread begun by the java interpreter when it executed your program 
beginning with its "main" function. And even if you could, wouldn't all 
its children sleep too?

In any case, if you need to do something sophisticated with thread 
programming you might try:

Java Threads by Scott Oaks and Henry Wong




O.K. Now for the Palindromes:

I'll quote some of the famous ones you all probably already know:

 From Napoleon after his defeat at Waterloo and exile to the island of
Elba in the Mediterranean:

Able was I, ere I saw Elba.


Another palindrome from antiquity:

Madam I'm Adam.

More recent:

Dennis sinned.

if

fi

(Bash script)


Some of my own:

A Toyota

Fool aloof

My Gym

Loot a tool

Wolf flow

Not a Photon  (Well, almost, were it not for ridiculous spellings in
the English language)


Russian, on the other hand, while worlds away from English in both 
pronunciation and grammar, has a completely logical and for the most 
part phonetic system.



At any rate, a nice way to extend the exercise might be to find/verify 
palindromes in other languages, as Java was built from the ground up to 
work with any language.

Enough to keep any Text Processing Geeks busy.



   --Dooshe






0
Reply nvpkdp 4/5/2007 4:02:09 AM

2 Replies
102 Views

(page loaded in 0.063 seconds)

Similiar Articles:













7/31/2012 2:10:14 AM


Reply: