SHARE
TWEET

Untitled

a guest Dec 9th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Main{
  2.      public static void main(String []args){
  3.         Test a = Test.create(1);
  4.         System.out.println(a.getId());
  5.      }
  6. }
  7. class Test {
  8.      private int id;
  9.      private Test() {}
  10.      
  11.      public static Test create(int id) {
  12.         Test t = new Test();
  13.         t.id = id;
  14.         return t;
  15.      }
  16.      public int getId() {
  17.          return this.id;
  18.      }
  19.      
  20.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top