Hi,
The solution doesn't cover fourth requirement. I haven't created Dream object, so I don't know what's wrong. Could you help, please? :)
package pl.codegym.task.task13.task1305;
/*
Cztery błędy
*/
public class Solution {
public static void main(String[] args) {
System.out.println(Hobby.HOBBY.toString());
System.out.println(Hobby.HOBBY.toString());
}
interface Desire {
}
interface Dream {
public static Hobby HOBBY = new Hobby();
}
public static class Hobby implements Dream, Desire {
static int INDEX = 1;
@Override
public String toString() {
INDEX++;
return "" + INDEX;
}
}
}