Anonymous Inner Class

main()
{ 
A obj = new A();
 {
 func(){
 Syso("This is an anonymous class")
  }
 }
}

OR (post Java 8)

main()
{ 
A obj = () -> Syso("anonymous class")

}