• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to create a constructor for anonymous inner class

 
vinodreddy kisanagaram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to create a constructor for anonymous inner class? If so, how?
 
Kishore Kumar
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you cannot have a constructor in an anonymus class, because you don't have the name of the class. Instead you can add an instance initialization block which acts like a constructor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic