• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anonymous class of concrete class  RSS feed

 
Karen Boxby
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was part of a question from the ExamLab's practice tests, but I've also seen it elsewhere and don't understand it. Why can you create an anonymous class by overriding an existing concrete class - is it essentially an anonymous base class that's being created?
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it essentially an anonymous base class that's being created


An anonymous derived class is being created with a single instance.
 
Karen Boxby
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ... I meant to say subclass, but derived it is. I appreciate you clearing up that mystery!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karen Boxby wrote:I meant to say subclass, but derived it is.

Those two things mean the same.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!