Package models

Examples of models.Singleton2


*/
public class TestSingleton2 {

  public static void main(String args[]) { 
   // Construct 2 singleton1 objects using the instance method
  Singleton2 s2a = Singleton2.uniqueinstance;
  Singleton2 s2b = Singleton2.uniqueinstance;
  // Set the data value.
  s2a.setData(34);
  System.out.println("First singleton2: " + s2a);
  System.out.println("First singleton2 data value =  " +s2a.getData());
  System.out.println("Second singleton2: " + s2b);
  System.out.println("Second singleton2 data value =  " +s2b.getData());
  }
View Full Code Here

TOP

Related Classes of models.Singleton2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.