Originally posted by Amy Cha: I know what a class declaration is. But what exactly is an object declaration? ...
Actually, I don't think the term "object declaration" is commonly used in Java.
I've seen "object declaration" used to describe memory being allocated for the instance itself (e.g., OOPic), but I've also seen it used to describe memory being allocated only for a reference (e.g., Willamette University lecture notes). So there seems to be some confusion other this term.
I think it's more common (and clear) in Java to say that we declare variables that reference objects that we "create" or "instantiate."
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
"Xyz Abc", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.
Failure to comply will result in the removal of your account.
Originally posted by Xyz Abc: [QB]I know what a class declaration is. But what exactly is an object declaration? Can anyone give me an example? Thanks.
It'll help if you can cite the source you read this term from, or describe the context in which you heard it used. As Marc said above, Java programmers don't really use the term "object declaration". Instead, you're most likely talking about either declaring a reference variable or instantiating a class--but it's hard to tell unless you provide more info.
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad: