Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


karteek
multi threading
1 Answer(s)      5 years and 7 months ago
Posted in : Java Interview Questions



Advertisement
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  How does multithreading take place on a computer with a single CPU
Java multi-threading
Java multi-threading  What method is invoked to cause an object to begin executing as a separate thread
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
Threading       Introduction:   Threading concept is very important in Java Programming language... and code. By using threading we can increase the speed of any application. Parallel
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 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 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
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
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
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
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
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
Multi PortType in NuSOAP - WebSevices
Multi PortType in NuSOAP  I would like to create a SOAP Server with atleast 2 PortType UserPortType and AccountPortType my problem is I cant combine both 2 PortType in the same Server page
Multi-threaded Programming
Multi-threaded Programming  Write a class resourceThread which has a method run which calls display method of resource class. Resource class has synchronized display method which prints the array string. Take a string
Multi-Date Handling Problem
Multi-Date Handling Problem  In our project we are using Oracle 10g as our data base, the problem is that we are picking In-date & Out-date from a calendar and on the basis of that date we are checking that on that date some
JDBC-ODBC Bridge multi-threaded.
JDBC-ODBC Bridge multi-threaded.  Is the JDBC-ODBC Bridge multi-threaded
multi threads - Java Beginners
multi threads  Hi i writing a multi threaded program in java .I m using three threads. I want to declare variables which will be available to all the threads to access. Is there a way to declare the variables as global variables
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
java multi - Java Beginners
java multi  Q. 1. Write a class with a special member function to input a multi digit number ( max. 9 digit) and print the following: (15) 1. total...; System.out.println("Enter multi digit number."); Scanner input = new Scanner
Threading in Java
Threading in Java         Overview of Thread Threading concept is very important in Java Programing language. A thread is a sequential path
java multi thread - Development process
java multi thread  Develop multi-threaded echo server and a corresponding GUI client in Java.please immediately reply me sir.its very urgent sir
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... anything that is why when extending a Thread class for threading, the run
 

 

 

DMCA.com