This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Doubt in K&B SCJP 5: topic Constructor Chaining

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am reading K & B book "Java 5 Study Guide" - enjoying the book so far and had a question on your Constructor Chaining section (Chapter 2, page 128).

Imagining the scenario where Horse subclasses Animal - Animal subclasses java.lang.Object.

- in Step 4 K & B says that "Object instance variables are given their explicit values"
- What are these Object instance variables?
I assume they dont refer to the instance variables in the Horse object which is mentioned separately in Step 8
 
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sanjay,

You asked ... "What are these Object instance variables? .. I assume they dont refer to the instance variables in the Horse object which is mentioned separately in Step 8" ...

Step 4 is referring to instance variables of java.lang.Object ...

Step 3 describes how the "ultimate superclass" of all classes Object(java.lang.Object) has its constructor invoked.
Step 4 - Objects instance variables are given default vaules.
Step 5 - Objects constructor completes.

Hope this helps ..

kf
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic