Originally posted by badri nath:
But if there is approach then it might be suitable in some applications.As of now im not able to know in what type of situations it is required.
There is no emoticon for what I am feeling!
Originally posted by badri nath:
Hi Arvind
Ya i know that implementing is best practice as you rightly said if we extend thread class then we will not be able to extend any other class. But if there is approach then it might be suitable in some applications.As of now im not able to know in what type of situations it is required.
Please, can any one make this clear by showing an example.
With Regards Badri
But if there is approach then it might be suitable in some applications.As of now im not able to know in what type of situations it is required.
Please, can any one make this clear by showing an example.
There is no scenario that mandates extending Thread rather than implementing Runnable that I am aware of.
Originally posted by Parag Ballal:
If a design requires Applet object to act as a Thread, then using Runnable inteface becomes obligatory.
Originally posted by shailesh Jammie:
Hi,
When we will use the approach of extending Thread class where we need a class fully dedicated to the particular thread operation.
let us take an example:
for an application we have to show progress bar according to the
progress of a work like fetching large data from database.
So what we will do is we can create two classes:
one main class fetching the data from db and according to the status of fetched data it will send this progress to the another class dedicated
to display the progess bar in the screen.
By this way the second class is fully dedicated thread of displaying progress bar diffrent from main operation of fetching data.
i hope you understood.
regards
Shailesh
There is no emoticon for what I am feeling!
Originally posted by shailesh Jammie:
Hi,
When we will use the approach of extending Thread class where we need a class fully dedicated to the particular thread operation.
let us take an example:
for an application we have to show progress bar according to the
progress of a work like fetching large data from database.
So what we will do is we can create two classes:
one main class fetching the data from db and according to the status of fetched data it will send this progress to the another class dedicated
to display the progess bar in the screen.
By this way the second class is fully dedicated thread of displaying progress bar diffrent from main operation of fetching data.
i hope you understood.
regards
Shailesh
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|