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

calling abstract methods from non-abstract methods..

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does it not complain about defining f1() as abstract....

yes, it helps to control the flow but any other "semantical" reasons for this .
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aadhi,
Why does it not complain

I assume "it" refers to the compiler. In other words, you want to know why the code (you have posted) compiles, right? Compilers usually only check syntax and dependencies. As long as you have some subclass (of "AbstractClass") that implements method "f2()", you should be fine.
So are you saying that your code compiles even without such a subclass?
Cheers,
Avi.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Avi Abrami:

I assume "it" refers to the compiler.
In other words, you want to know why the code (you have posted) compiles, right?

yes!

Compilers usually only check syntax and dependencies. As long as you have some subclass (of "AbstractClass") that implements method "f2()", you should be fine.

To reformat, I can't do this(topic), in a concrete class. But is there any hidden meaning to allow this in an abstract class(i could guess only flow control).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic