how to create thread in java?
Answers were Sorted based on User's Feedback
Answer / manju
Thread can be created by
1. Extending Thread Class
2. implementing Runnable interface
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / chiranjeevi
threads are created in two ways
1.extending threadclass
2.runnable interface
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / teja
We r creating threads in java by extending d thread class
or by implementing runnable interface.
Syntax for creaton of thread is:
Thread var=new Thread(Runnableobject,"Stringname");
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ravi gandhi
threads are created in two ways
1.implementing Runnable interface
2.Extending Thread Class
in thees two ways implements runnable interface is better
option because it supports multilevle thread cocept
| Is This Answer Correct ? | 0 Yes | 0 No |
Threads are created in three ways
1. Sub-class Thread: Create sub-class of java.lang.Thread class
2. Runnable object: Implementing java.lang.Runnable interface.
3. Callable object: Implementing java.lang.Callable interface.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / hari
It can also be created in number of ways.
1.Extended threadclass
2.Running thread
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / solanki
It was created by extended from Thread class
and also we can create from interface thred
| Is This Answer Correct ? | 2 Yes | 8 No |
program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number
The company is a fake company asking for money of RS10000 while training and not offering a job after training. My humble request to you people not to attend Astersys interview
what is the application of oops?
What is a class in oop?
write a program that takes input in digits and display the result in words from 1 to 1000
diff between Virtual mathod and abstract method?
What is a class and object?
#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.
why destructor is not over loaded?
You have one base class virtual function how will call that function from derived class?
What is oops?what is its use in software engineering?
Templates mean