how to create thread in java?

Answer Posted / vamsikrishna

we can do it in two ways.
one is by extending thread class and other is by
implementing Runnable interface.
here the later one is good because when we are going for
mutiple inheritance only interface helps us

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a class in oop?

595


What polymorphism means?

617


What is data binding in oops?

582


What are the data types in oop?

600


what is the sylabus for priliminaries?

1679






What is the significance of classes in oop?

586


What is overriding in oop?

546


Why polymorphism is used in oops?

578


what is graphics

2005


Why is object oriented programming so hard?

611


Why interface is used?

549


What is the full form of oops?

606


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

1694


What is difference between polymorphism and inheritance?

616


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

625