Skip to content

Instantly share code, notes, and snippets.

@fermopili
Created March 19, 2017 12:28
Show Gist options
  • Save fermopili/636fab3a309f848a714d9fcd38333e7f to your computer and use it in GitHub Desktop.
Save fermopili/636fab3a309f848a714d9fcd38333e7f to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1320
/*
Neo
*/
public class Solution
{
public static void main(String[] args) throws Exception
{
System.out.println(Matrix.NEO);
}
static class Matrix
{
public static DBObject NEO = new User().initializeIdAndName(1, "Neo");
}
interface DBObject
{
DBObject initializeIdAndName(long id, String name);
}
static class User implements DBObject
{
long id;
String name;
public User initializeIdAndName(long id, String name)
{this.id=id;
this.name=name;
return this;
}
;
@Override
public String toString()
{
return String.format("User has name %s, id = %d", name, id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment