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

Chapter 1 page 47

 
pablo santamarta esteban
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the beginning, second paragraph says:

'Finally, you need to know that -for top-level classes- the abstract modifier can never be combined with the static modifier. We'll cover static method later in this objective, but for now just remember that the following would be illegal:
abstract static void doStuff();'

The phrase in bold should be removed? As top-level classes are not allowed to be marked as static and it is actually talking about methods.

 
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
Hi pablo santamarta esteban,

First of all, a warm welcome to CodeRanch!

pablo santamarta esteban wrote:'Finally, you need to know that -for top-level classes- the abstract modifier can never be combined with the static modifier. We'll cover static method later in this objective, but for now just remember that the following would be illegal:
abstract static void doStuff();'

The part in bold is important and should not be removed! Because you can create a static nested class which is abstract. Illustrated in the following code snippet:So Pizza is a static nested abstract class, so the combination is allowed for static nested classes, but not for top-level classes. So without the part in bold, that statement would be clearly incorrect (as shown in this code snippet).

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic