Sponsered Links
Categories
Sponsered Links

Java ThreadSafe Example

 

 This is a simple Java ThreadSafe Example.

 import java.util.Collections;

import java.util.HashSet;
import java.util.Set;

public class ThreadSafeExample {
public static void main(String[] args) {
Set set = new HashSet();
set.add("Apple");
set.add("Banana");
set.add("Grapes");
set.add("Mango");
set.add("Strawberry");
set.add("Orange");
set.add("Papaya");
Collections.synchronizedSet(set);
}
}

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved