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
Can we define a class within the interface?
What is overloading in oop?
What is multilevel inheritance explain with example?
What is oops concept with example?
Why is object oriented programming so hard?
What is the renewal class?
What is property in oops?
What is the purpose of enum?
How does polymorphism work?
What is the difference between procedural programming and oops?
What is abstraction oop?
What is an example of genetic polymorphism?
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
How is class defined?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)