The result is ok
Implements the DBObject initializeIdAndName method.
Initializing the variables passed by the method.
I pass the result through the User and this class.
However, he does not complete the task for me.
package pl.codegym.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");
}
public interface DBObject
{
public DBObject initializeIdAndName(long id, String name);
}
static class User implements DBObject
{
long id;
String name;
public DBObject initializeIdAndName(long id, String name)
{
this.id = id;
this.name = name;
//System.out.println(id + " " + name);
return User.this;
}
@Override
public String toString()
{
return String.format("Imię użytkownika to %s, id = %d", name, id);
}
}
}