Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. public class SingletonTest{
  2.  
  3. public static void main(String[] args){
  4.  
  5. Earth e1 = Earth.getInstance();
  6.  
  7. Earth e2 = Earth.getInstance();
  8.  
  9. System.out.println(e1==e2);
  10. //Above statement should always return true for singleton.
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement