What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class?
Answer Posted / bindhu solomon
Creating a thread using implementing Runnable interface
are more advisable. Suppose we are creating a thread by
extending a thread class, we cannot extend any other class.
If we create a thread by implementing Runnable interface,
we can extend another class.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Why put method is used?
Can we have return statement in finally clause? What will happen?
What an i/o filter?
How will you reverse a link list without using recursion?
When should I use a singleton?
Why is it important to initialize a variable?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
Is java a utf 8 string?
What is the gregoriancalendar class in java programming?
Explain about serializable interface in java?
Where is const variable stored?
How many types of variables are there?
What is variable argument in java?
Why singleton is not thread safe?
What is classname class in java?