• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Chapter 1 page 47

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Police line, do not cross. Well, this tiny ad can go through:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic