Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main{
- public static void main(String []args){
- Test a = Test.create(1);
- System.out.println(a.getId());
- }
- }
- class Test {
- private int id;
- private Test() {}
- public static Test create(int id) {
- Test t = new Test();
- t.id = id;
- return t;
- }
- public int getId() {
- return this.id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement