View Single Post
  #2 (permalink)  
Old 04-09-2008, 04:35 AM
CaptainMorgan's Avatar
CaptainMorgan CaptainMorgan is offline
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Welcome to the forums. First, please read the FAQ before you post again.

What looks like a constructor is placed inside of main(). Move that(and make it public) and the class's fields to outside of main(). And finally, the calls to the class member fields are made from a static context- you need to reference them instead. In other words, you make a Car object: carA, but you don't use it. To access a member field, use the "." operator via:
Code:
carA.invoice;
Post your updated attempt if you get stuck.

See you around!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Reply With Quote