Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how many ways to create Thread and which one is good?
runnable interface ot Thread class?

Answers were Sorted based on User's Feedback



how many ways to create Thread and which one is good? runnable interface ot Thread class?..

Answer / balaji@cse@crr engg@eluru

types of creating thread
1)extend thread class
2)implement by runnable interface
=>2"nd method is good because by using interface we can
implement multiple inheritance

Is This Answer Correct ?    16 Yes 0 No

how many ways to create Thread and which one is good? runnable interface ot Thread class?..

Answer / guest

Two ways to create threads
1)by creating thread class
class classname extends Thread
{


}
2)By converting class to thread ie using Runnable interface

Is This Answer Correct ?    11 Yes 3 No

how many ways to create Thread and which one is good? runnable interface ot Thread class?..

Answer / srinu

Two ways of creating Thread
1)By extending java.lang.Thread class
2)By implementing java.lang.Runnable interface
Here 2"nd way is good because by using interface we can
implement multiple inheritance in our class

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is meant by UP& DOWN casting in java?

6 Answers  


Why put method is used?

0 Answers  


What is the difference between Java1.4 and Java1.5

0 Answers   NIIT,


give me the answer of this code class A extnds String This code we can write r not in Java? Explain?

4 Answers  


What is the purpose of using bufferedinputstream and bufferedoutputstream classes?

0 Answers  


Can we have multiple public classes in a java source file?

0 Answers  


What are the differences between path and classpath variables?

0 Answers  


how to write a server program and sending the mails to the server using smtp protocol please help me

0 Answers   Lampex,


Why put method is idempotent?

0 Answers  


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

0 Answers  


What is multi level inheritance in java?

0 Answers  


How do you convert bytes to character in java?

0 Answers  


Categories