alcuni test su synchronized e singleton
This commit is contained in:
22
threads_test/test_2_start.java
Normal file
22
threads_test/test_2_start.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package threads_test;
|
||||
|
||||
/**
|
||||
* Created by Giovanni on 12/10/2014.
|
||||
*/
|
||||
public class test_2_start {
|
||||
|
||||
public static void main (String[] args) {
|
||||
|
||||
|
||||
test_2_singleton o= test_2_singleton.get_instance();
|
||||
test_2_singleton o2= test_2_singleton.get_instance();
|
||||
|
||||
if (o == o2 )
|
||||
System.out.print("Equal");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user