Project sample = new Project();
This means creating a variable sample of type project, creating an object and assigning it to variable.
What does below code mean
Project sample = new Project() {
private void Test(){
}
}
Test is a method, What this code means, How do Test() can be invoked ?
Thanks
In addition to other answers. This kind of anonymous classes are very useful when you’re implementing
interfaceor extendingabstractclass. For instance:And here is your implementation:
This line will give you an error: