can u override the start() method of Thread class
Answers were Sorted based on User's Feedback
Answer / gcd
Yes you can override the start method of the thread class.
if you extend from the thread class. and override.
then only start method will be called
| Is This Answer Correct ? | 14 Yes | 3 No |
Answer / vishwanath
We can override start() method but it is not recommended.
Why because...the start() method of Thread class first
registers a new thread with the Thread Scheduler and it
invokes run() method.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sandya
Subhareddy, can u please send me one example on above
question??
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / raju singh
class Car extends Thread
{
@override
public void run()
{
super.start();
System.out.println("This is start in car class");
}
@override
public void run()
{
System.out.println("Car is running");
}
}
class Application
{
public static void main(String []args)
{
Car c=new Car();
c.start();
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
we can override start() method present in Thread class.but
we have to follow following steps:
1) first our class must extend thread class.
2)then we have to override thread class start() in such way
that :
a) It should instantiate and register our new thread with
thread scheduler.
b) it should call run() method.(it may be our overridden
run method or thread class run() method)
| Is This Answer Correct ? | 5 Yes | 7 No |
what are the high-level thread states? : Java thread
what is real-time example of runtime polymorphism and compile time polymorphism
What is the best way to findout the time/memory consuming process?
write a program to create an arraylist with string(add,remove) operation.and value should be enter through keyboard.
How do you reverse a string in java?
What is the symbol for space?
How is rounding performed under integer division?
What are the advantages of packages in java?
Define inheritance?
Give us a program to check for parenthesis matching using stack.
What is instance means in java?
Can a constructor be made final?