Threads Program

N

nish

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.

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.


Looking forward to your suggestions

THanks

Nish
 
N

nvpkdp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top