|
-
October 18th, 2011, 11:47 AM
#10
Re: Why we use initialization block
So what you are saying is that a comment in a book you read is more accurate than the documentation listed on oracle.com? 
What is misleading about the statement? It doesn't execute "as if it was placed at the beginning" it IS placed at the beginning. Your statement (taken from the book, granted) is more misleading IMHO because it says "as if" when in actuality it "is" placed right after the call to super().
"The static initializers are executed after a class is loaded before it is actually used"
Okay, so? What does this have to do with the conversation at hand? It says the same thing pretty much in the specification:
12.1.2 Link Test: Verify, Prepare, (Optionally) Resolve
After Test is loaded, it must be initialized before main can be invoked.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|