Tuesday, January 21, 2014

Threads



1.If you have to write a thread based application in JAVA u will extend Thread class or implement Runnable interface?

2.What is the difference between Vector and ArrayList in Java?Is Vector thread safe class?

In the below code does using vector help in multithreading?

Class
{
Vector v
//2 threads that access v
// add elements
//remove elements
//more code
}
 
Is this code thread safe ?
3. synchronized class A
{
}
will this compile?

No comments:

Post a Comment