Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Is it possible to call run() method instead of start() on a thread in Java?

Pragya Keshap answered on February 4, 2023 Popularity 5/10 Helpfulness 1/10

Contents


More Related Answers

  • how to run function on different thread python
  • java create new thread
  • How can we make a regular thread Daemon thread in Java?
  • System.Threading;
  • run in thread decorator
  • Java Thread Example by implementing Runnable interface
  • thread in java
  • thread in java
  • java run thread
  • Explain about interrupt() method of thread class ?
  • threads in java
  • Java Thread Example Using the Thread Class
  • What is a Thread in Java?
  • create thread java
  • java thread
  • System.Threading;
  • return value from a thread
  • Object state) at System.Threading.ThreadHelper.ThreadStart() pywebview
  • can we start a thread twice
  • Explain about interrupt() method of thread class ?
  • What does this code do? Thread thread = new Thread(new Runnable() { @Override public void run() { System.out.println("Executing from a new thread"); } });
  • Starting a New Thread
  • Creating Threads Using java.util.concurrent.ThreadFactory
  • Can we start a thread two times in Java?
  • What are the two ways of implementing thread in Java?
  • Thread (computing)
  • If you call the isINterrupted() method of a thread object twice, teh second call will always return false./ TRUE Or FALSE
  • Java Thread
  • java program to implement thread

  • Is it possible to call run() method instead of start() on a thread in Java?

    0

    Yes. We can call run() method of a thread. But it does not work as a

    separate thread. It will just work as a normal object in main thread

    and there will not be context switching between the threads.

    https://java2blog.com/can-we-call-run-method-directly-to-start-thread/#:~:text=No%2C%20you%20can%20not%20directly,in%20same%20stack%20as%20main.

    Popularity 5/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: call java
    Link to this answer
    Share Copy Link
    Contributed on Feb 04 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.