Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract modifier added by the compiler to interface

 
Jason Attin
Ranch Hand
Posts: 232
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI guys, I've noticed something while reading the OCA book. On page 268 it says that if you declare an interface and omit the modifier abstract, the compiler will do it for you.
On page 274 there is another example with interface variables, which, if declared without the public static final keywords, it is said, the compiler will add them for you. There is however the modifier abstract missing there, here is the code:

The above is the one with the missing keyword, which, the book says, will be automatically converted to this:


However, the keyword abstract is missing from . At first I got really confused, but then going back in the book I noticed that it should be there because the compiler adds it automatically. It's not in the errata either, I've checked.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Attin wrote:However, the keyword abstract is missing from

You can find a discussion about the same code snippet in this topic.
 
Jason Attin
Ranch Hand
Posts: 232
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, OK thanks for that. The reason why I posted that is exactly the same as the other OP, because the book said that the compiler DOES indeed convert the first to the second one. Anyway, I read the whole thread so it's OK now, thanks for the link!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic