Overloading of Thread Class run() Method Last Updated : 25 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In Java, overloading the run() method of the Thread class is possible. But the start() method of the Thread class internally calls only the no-argument run() method. The other overloaded versions of run() must be invoked explicitly like a normal method call.Behavior of Overloaded run() MethodLet’s look at an example to understand what happens when we overload run() in a thread class.Example: Overloading run() Method Java // Java Program to illustrate the behavior of // run() method overloading class Geeks extends Thread { public void run() { System.out.println("GeeksforGeeks"); } public void run(int i) { System.out.println("Sweta"); } } class Test { public static void main(String[] args) { Geeks t = new Geeks(); t.start(); } } OutputGeeksforGeeks Explanation: The run(int i) is defined, but the start() method only calls run(). The overloaded method run(int i) is ignored if not explicitly invoked.Runtime stack provided by JVM for the above program:Important Note on Thread Stack BehaviorThe JVM creates a new call stack for the run() method when the thread is started using start(). If we manually call run(int i) or any other overloaded run() method, it executes in the main thread’s call stack, just like any regular method.Example: Calling Overloaded run(int i) Method Explicitly Java // Java Program to illustrate the execution of // program using main thread class Geeks extends Thread { public void run() { System.out.println("GeeksforGeeks"); } public void run(int i) { System.out.println("Sweta"); } } class Test { public static void main(String[] args) { Geeks t = new Geeks(); // Manually calling overloaded method t.run(1); } } OutputSweta Runtime stack provided by JVM for the above program:Notes:We can overload the run() method in a thread class.The start() method will only invoke the no-arg run().The overloaded run() methods must be explicitly called and do not execute in a new thread.Try to avoid overloading run() method to reduce confusion. If different behavior is needed, use different method names. Comment More infoAdvertise with us Next Article Overloading of Thread Class run() Method B Bishal Kumar Dubey Improve Article Tags : Misc Java Java-Multithreading Practice Tags : JavaMisc Similar Reads Overriding of Thread class start() method Whenever we override start() method then our start() method will be executed just like a normal method call and new thread wont be created. We can override start/run method of Thread class because it is not final. But it is not recommended to override start() method, otherwise it ruins multi-threadi 2 min read Ruby | Thread Class-Public Class Methods In Ruby, threads are used to implement concurrent programming module. Programs that required multiple threads, use the Thread class to create threads. Thread class contains a wide range of methods that perform some specified tasks. Public Class Methods abort_on_exception : This method returns the st 4 min read run() Method in Java Thread The run() method is available in the thread class constructed using a separate Runnable object. Otherwise, this method does nothing and returns. We can call the run() method multiple times. The run() method can be called in two ways which are as follows:Using the start() method.Using the run() metho 3 min read Java Thread Class Thread is a line of execution within a program. Each program can have multiple associated threads. Each thread has a priority which is used by the thread scheduler to determine which thread must run first. Java provides a thread class that has various method calls to manage the behavior of threads b 5 min read Java Thread.sleep() Method Thread class contains the sleep() method. There are two overloaded methods of sleep() method present in Thread Class, one is with one argument and another one is with two arguments. The sleep() method is used to stop the execution of the current thread (whichever might be executing in the system) fo 3 min read Java.lang.Runtime class in Java In Java, the Runtime class is used to interact with Every Java application that has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime() method. Methods of Java 6 min read Java.lang.ThreadLocal Class in Java This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. Basically, it is another way to achieve thread safety apart from writing im 4 min read Java Thread.start() vs Thread.run() Method In Java's multi-threading concept, start() and run() are the two most important methods. In this article, we will learn the main differences between Thread.start() and Thread.run() in Java. Thread.start() vs Thread.run() MethodThread.start()Thread.run()Creates a new thread and the run() method is ex 4 min read java.lang.management.ThreadInfo Class in Java java.lang.management.ThreadInfo class contains methods to get information about a thread. This information includes: Thread IDThread NameState of the ThreadStack trace of the ThreadThe object upon which the Thread is blockedList of object monitors that are blocked by the ThreadList of ownable synchr 4 min read Java Thread Priority in Multithreading Java being Object-Oriented works within a Multithreading environment in which the thread scheduler assigns the processor to a thread based on the priority of the thread. Whenever we create a thread in Java, it always has some priority assigned to it. Priority can either be given by JVM while creatin 5 min read Like