how to create thread in java?

Answer Posted / vijay tandel

Thread can be created by

1. Extending Thread Class
2. implementing Runnable interface

The second approach is better as if you want to use multiple
inheritance, interface is better option.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1991


Why we use classes in oop?

585


What is an example of genetic polymorphism?

651


What are the 4 pillars of oop?

674


What is oops in simple words?

585






What is abstraction encapsulation?

661


is there any choice in opting subjects like 4 out of 7

1733


What is polymorphism in oops?

560


Where You Can Use Interface in your Project

1429


write string class as your own class in java without using any built-in function

1978


What is polymorphism and types?

603


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1419


What causes polymorphism?

577


What is oops with example?

566


Write a program to reverse a string using recursive function?

1795