multi threading

multi threading

View Answers

March 9, 2009 at 2:26 AM

Hi friend,

While implementing the concept of multithreading there are two ways to implement.

1. Extending the Thread Class and
2. Implementing the Runnable Interface

By Extending the Thread class makes you unable to extend other classes since it doesn't support Multiple Inherictance.
By implementing Runnable interface we can acheive better OOPs design and can avail more than one interface for a sigle class.

Therefore implementing Runnable interface is better than extending Thread class. For further more information over Multithreading concepts visit http://www.roseindia.net/java/thread/CreationOfMultithreads.shtml


Thanks
RoseIndia Team









Related Tutorials/Questions & Answers:
Java multi-threading
Java multi-threading  What is multi-threading
Multi Threading
Multi Threading  Hi... I need to solve the following question: Input an array of 10 integers. Separate the odd numbers, even numbers, positive numbers and negative numbers by different threads. I tried to solve it but I dont
Advertisements
what is multi-threading .?
what is multi-threading .?   what is multi-threading.what is the use in real time, with example programs
Multi Threading is not working in that why...?
Multi Threading is not working in that why...?   import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Date; public
Java multi-threading
Java multi-threading  What method is invoked to cause an object to begin executing as a separate thread
Java multi-threading
Java multi-threading  How does multithreading take place on a computer with a single CPU
Multi-Threading - Java Beginners
Multi-Threading  Consider a producer process prime-generator produces prime numbers randomly that are displayed by a consumer process called prime-sorter . prime-sorter will display the prime number if it is greater than
multi threading - Java Interview Questions
multi threading   1. extending a thread and 2. implementing runable interface is used in multi threading concept in both of this which one good and why can u explain   Hi friend, While implementing the concept
multi threading code - Java Interview Questions
multi threading code  Hi this is Anji.My question is how to share the variable between two threads?.Can any one post the answer please
Threading
Threading   striker thread problem solution
Threading Program
Threading Program  Hi, write a java program that *continuously prints* "HelloWorld!" to the screen**(once every** second ) and **exists when press the enter key
threading
ModuleNotFoundError: No module named 'extended_threading'
ModuleNotFoundError: No module named 'extended_threading'  Hi, My... named 'extended_threading' How to remove the ModuleNotFoundError: No module named 'extended_threading' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'extended_threading'
ModuleNotFoundError: No module named 'extended_threading'  Hi, My... named 'extended_threading' How to remove the ModuleNotFoundError: No module named 'extended_threading' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'micropython-threading'
ModuleNotFoundError: No module named 'micropython-threading'  Hi...: No module named 'micropython-threading' How to remove the ModuleNotFoundError: No module named 'micropython-threading' error? Thanks   Hi
ModuleNotFoundError: No module named 'micropython-threading'
ModuleNotFoundError: No module named 'micropython-threading'  Hi...: No module named 'micropython-threading' How to remove the ModuleNotFoundError: No module named 'micropython-threading' error? Thanks   Hi
ModuleNotFoundError: No module named 'pycopy-threading'
ModuleNotFoundError: No module named 'pycopy-threading'  Hi, My... named 'pycopy-threading' How to remove the ModuleNotFoundError: No module named 'pycopy-threading' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'threading-futures'
ModuleNotFoundError: No module named 'threading-futures'  Hi, My... named 'threading-futures' How to remove the ModuleNotFoundError: No module named 'threading-futures' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'threading-sched'
ModuleNotFoundError: No module named 'threading-sched'  Hi, My... named 'threading-sched' How to remove the ModuleNotFoundError: No module named 'threading-sched' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'threading_tools'
ModuleNotFoundError: No module named 'threading_tools'  Hi, My... named 'threading_tools' How to remove the ModuleNotFoundError: No module named 'threading_tools' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'click-threading'
ModuleNotFoundError: No module named 'click-threading'  Hi, My... named 'click-threading' How to remove the ModuleNotFoundError: No module named 'click-threading' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'continuous-threading'
ModuleNotFoundError: No module named 'continuous-threading'  Hi...: No module named 'continuous-threading' How to remove the ModuleNotFoundError: No module named 'continuous-threading' error? Thanks   Hi
ModuleNotFoundError: No module named 'extended_threading'
ModuleNotFoundError: No module named 'extended_threading'  Hi, My... named 'extended_threading' How to remove the ModuleNotFoundError: No module named 'extended_threading' error? Thanks   Hi, In your
Java RMI and Threading
Java RMI and Threading  Hi, We are using threading and RMI in my application. Its a continuously runing application and run it as service, We are reading some packet from the server. The issues are, 1. But some data are missing
ModuleNotFoundError: No module named 'micropython-dummy_threading'
ModuleNotFoundError: No module named 'micropython-dummy_threading'  ...: No module named 'micropython-dummy_threading' How to remove the ModuleNotFoundError: No module named 'micropython-dummy_threading' error? Thanks
ModuleNotFoundError: No module named 'opencensus-ext-threading'
ModuleNotFoundError: No module named 'opencensus-ext-threading'  Hi...: No module named 'opencensus-ext-threading' How to remove the ModuleNotFoundError: No module named 'opencensus-ext-threading' error? Thanks  
ModuleNotFoundError: No module named 'pycopy-dummy_threading'
ModuleNotFoundError: No module named 'pycopy-dummy_threading'  Hi...: No module named 'pycopy-dummy_threading' How to remove the ModuleNotFoundError: No module named 'pycopy-dummy_threading' error? Thanks   Hi
multi language
multi language  Hello friends please help me Hi how can i do a java program using swing that changes the language like malayalam/tamil etc with languages on a drop down menu I am using netbeans IDE
multi thread
multi thread   Multiple Clients Connect to a server and communicate among the themselves. When a new Client is connected to the server, all other clients get the notification and they can chat with each other. Similarly when
multi dimension
multi dimension  class TwoDAgain{ public static void main(String args[]){ int twoD[][]=new int[4][]; twoD[0]= new int[1]; twoD[1]= new int[2]; twoD[2]= new int[3]; twoD[3]= new int[4]; int i, j, k = 0; for (i=0; i<4; i
Multi window
Multi window  I am making a bank app using struts 1.2. using only the struts tags and nno jsp tags and scriplets. db connected thru dao. 1st page contains all the details. when i submit this page, a new window opens and asks
how to call a frame having threading concept
how to call a frame having threading concept   i hav a frame having buttton on it .on click event of the button ,i want to call another frame which implements threading concept. i tried it simply by calling constructor
Threading in Java
Threading in Java         Overview of Thread Threading concept is very important in Java Programing language. A thread is a sequential path
Threading In Java Example
Threading In Java Example In this section we will read about how to create a thread and use it in Java. There are the two mostly used methods for threading... class for threading, the run() method should be override to provide its own
ModuleNotFoundError: No module named 'multi'
ModuleNotFoundError: No module named 'multi'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'multi' How to remove the ModuleNotFoundError: No module named 'multi'
about threading in java - Java Server Faces Questions
about threading in java  Hello Sir how can i write a program using threads and which need to check and compare the system date and time every day at certain time(eg:12 o clock in noon).. based on this comperision of time i
Java threading
Java threading
Java threading
Java threading
Java threading
Java threading
Java threading
ModuleNotFoundError: No module named 'ccw_threading_mixin_socket_server'
ModuleNotFoundError: No module named 'ccw_threading_mixin_socket_server' ...: ModuleNotFoundError: No module named 'ccw_threading_mixin_socket_server' How to remove the ModuleNotFoundError: No module named 'ccw_threading_mixin_socket_server'
java code for threading example for connecting data base
java code for threading example for connecting data base  Write a program that has two threads First thread queries the database and fetches all the employee records from the emp table. Stores the employee objects
Multi-value data - JDBC
Multi-value data  hey! actually am supposed to create this database that allows multi-value data.its supposedly going to become a very large database.only i dont know just how to begin creating it.what i need is mysql syntax
Multi value data - JDBC
Multi value data  Hello, please help,how do i use Multi-value data with mysql database. thank you  Hi friend, Plz explain your problem in details what you want and visit to : http://www.roseindia.net/jdbc/jdbc
how to call a frame having threading concept
how to call a frame having threading concept   i hav a frame having buttton on it .on click event of the button ,i want to call another frame which implements threading concept. i tried it simply by calling constructor
JDBC-ODBC Bridge multi-threaded.
JDBC-ODBC Bridge multi-threaded.  Is the JDBC-ODBC Bridge multi-threaded
sendimg multi sms
sendimg multi sms  i want to send multiple sms from a distribution list decleared in the server...how do i connect my code to server

Ads