Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Confusing static initialization

 
Greenhorn
Posts: 2
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All!

Could anybody please explain me why static initializers from Sub class are not executed in line 14?
I'd suspect either both sub and super should execute at that point, or none of them.
Since just the super gets executed, I'm a bit confused. What's the rule here?



Thank you in advance and Regards,
Piotr
 
Piotr Karpiewski
Greenhorn
Posts: 2
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well,

The forum suggestions under my post actually gave me a good hint to similar thread that has the explanation in it: https://coderanch.com/t/671641/certification/inheritance-static-initializers

The issue is clarified then. Sorry for messing the space!
Piotr
 
Marshal
Posts: 25676
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Piotr!

And also, thanks for answering your own question    We're always happy to see that displaying similar posts is a useful feature so I've given you a cow for letting us know.
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic