OBJECT declaration vs creation
Hi,
I'm at university and am about to take an exam on Java programming, one of the questions they said might come up on the exam could be: "Describe the difference between object declaration and creation."
I'm in the middle of writing my notes in prep for the exam and I know the answer obviously but I can't put it into words. This question could easily be worth up to 10 marks of a 100 mark paper so I was wondering if anyone has a link to some well worded answer I could learn in prep for the exam?
Thanks
Re: OBJECT declaration vs creation
This line declares an object:
and this line creates one:
Code:
obj= new YourObject();
Note that declaration and creation/initialization could've been done in one line:
Code:
YourObject obj= new YourObject();
kind regards,
Jos
Re: OBJECT declaration vs creation
Objects aren't declared, so the question is moot.
db
Re: OBJECT declaration vs creation