Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4324306
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:06:53+00:00 2026-05-21T09:06:53+00:00

package threadwork; public class WorkingWithThreads implements Runnable { public static void main(String[] args) {

  • 0
package threadwork;

public class WorkingWithThreads implements Runnable {

    public static void main(String[] args) {
        WorkingWithThreads wwt = new WorkingWithThreads();
    }

    public WorkingWithThreads() {
        System.out.println("Creating Thread");
        Thread t = new Thread();
        System.out.println("Starting Thread");
        t.start();
    }

    @Override
    public void run() {
        System.out.println("Thread Running");

        for (int i = 0; i < 5; i++) {
            System.out.println("Thread:" + i);
            try {
                Thread.sleep(1);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

When I run this code, it Prints Creating Thread and Starting Thread. But doesn’t prints Thread Running, that means run function is not at all called. Why is it so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:06:54+00:00Added an answer on May 21, 2026 at 9:06 am

    You have to call start() on the thread to get it to start; e.g.

    Thread t = new Thread();
    t.start();
    

    If you were extending Thread, you would create a new thread and call start() on it like this:

    new MyThread().start();
    

    Since you are not extending Thread, but your class implements Runnable:

    new Thread(new WorkingWithThreads()).start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package com.test01; public class test01 { public static void main(String[] args) { System.out.println(hi); }
package org.study.algos; public class Study { public static void main(String[] args) { A a
package testing.project; public class PalindromeThreeDigits { public static void main(String[] args) { int value
package hw3; public class Main { public static void main(String[] args) { final int
package javaapplication8; public class Main { public static void main(String[] args) { int[] list1
package pack; public class sample{ public static void main(String input[]) { NumberFormat numberFormat =
package matlab; import com.mathworks.toolbox.javabuilder.*; import com.eigenface.Eigenface; public class Test { public static void main(String[]
package pkgPeople; import java.io.Serializable; import java.text.DecimalFormat; public class Person implements Serializable{ private String name;
package javaapplication1; import java.io.*; public class Main { /** * @param args the command
package pkg_1; public class ExpOnWaitMethod extends Thread { static Double x = new Double(20);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.