Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract class and new()

 
Nitin Bhagwat
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why Java allows us to break rule of no new operator can be used for abstract class?

 
Joe Borderi
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Why Java allows us to break rule of no new operator can be used for abstract class?"

It doesn't. In this case, you are creating an anonymous class that extends Tester.
 
Muralidhar Mandapati
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the above example that you have provided it is considered to be a anonymous inner class and infact the code


can be viewed as a class that extends the Tester class and which implements run method.
 
Nitin Bhagwat
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Borderi , Muralidhar
 
sanjeevmehra mehra
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can be viewed as a class that extends the Tester class

I am not able to get this point, can you provide me more detail or source of information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic