Explain different ways of creating a thread?
Answer / Gautam Sinha
"There are several ways to create threads in Java:n
1. Extending Thread class: By creating a subclass of the Thread class and overriding its run() method.
2. Implementing Runnable interface: By implementing the Runnable interface and providing an implementation for its run() method.
3. Using ExecutorService: By using the ExecutorService interface to manage multiple threads, which can be useful for larger applications."
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between the file and randomaccessfile classes?
What is the difference between java and .Net?
we have two threads..both the threads are reading the data.. is there any need of synchronization there?...justify it?
What is tochararray in java?
What is boolean data type in java?
Which is dependent variable?
Is jdk required on each machine to run a java program?
What is use of a abstract variable?
What is a parameter in a function?
What are the interfaces defined by Java.lang package?
what is comparable and comparator interface?
Can you explain the private protected field modifier?