which of tha following is not a thread safe class?
a) ArrayList b)Vector c)HashTable d)None

Answers were Sorted based on User's Feedback



which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / ragubir singh

ArrayList

Is This Answer Correct ?    16 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / divya.c

a)ArrayList

Is This Answer Correct ?    12 Yes 1 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / gunjan

ArrayList is,unsynchronized, not thread safe, vectors r
thread safe and synchronized
if u want to make Arraylist as thread safe, should use
Collections class synchronizedList(List) method

Is This Answer Correct ?    11 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / samir vasani

a)ArrayList
Because ArrayList is not a synchronized ,means it is not a
thread safe

Is This Answer Correct ?    6 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / arjunkumar

Hey Guys n girls...
If you know the Answer Exactly den only post it, V dont want
Guess Answers as wel as Funny Ans, this is the site for not
fun, got it.

Is This Answer Correct ?    5 Yes 2 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / anonymous

hay submitted guy dun be angry!All person have their own view and assumption.
My answer is ArrayList.

Is This Answer Correct ?    1 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / sai

ArrayList is not Thread Safe Class.Because it is not
Synchronized.

Is This Answer Correct ?    1 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / soujanya

Arraylist is not threadsafe.

Is This Answer Correct ?    1 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / aravinda reddy

ArrayList is by default not thread safe, but we can make it
thread safe. Below is the example how we can make it thread
safe.

public class SynchronizeList {
public static void main(String[] args) {

ArrayList<String> al=new ArrayList<String>
();
al.add("1");
al.add("2");
al.add("3");

//we can make the synchronized
Collections.synchronizedList(al);

synchronized(al) {
Iterator i = al.iterator(); // Must
be in synchronized block
while (i.hasNext())
System.out.println(i.next());
}
}
}

Vector and HashTable are by default synchronized. These are
thread safe.

Hence the answer is ArrayList.

Is This Answer Correct ?    1 Yes 0 No

which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None..

Answer / divya

None

Is This Answer Correct ?    6 Yes 6 No

Post New Answer

More Core Java Interview Questions

What is printwriter in java?

0 Answers  


What is data movement?

0 Answers  


FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

1 Answers  


Can we have any code between try and catch blocks?

0 Answers  


What is difference between == and === in js?

0 Answers  






what is difference betwenn Access Specifier and Access Modifier ????

2 Answers  


What is the meaning of 3 dots in java?

0 Answers  


Is java same as core java?

0 Answers  


Is 0 a real number?

0 Answers  


When should we create our own custom exception classes?

0 Answers  


What is parameters example?

0 Answers  


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

0 Answers   HCL,


Categories