14.07.2013 Views

Contents - Cultural View

Contents - Cultural View

Contents - Cultural View

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Comparison of Java and C++ 85<br />

e="7.71"><br />

;<br />

the contents of a to a new Foo object b;<br />

ative syntax is "Foo b(a)"<br />

<br />

Foo b = a.clone();<br />

// copies the values of all members<br />

// of this instance if, and only if,<br />

// Foo implements a public method called<br />

// clone() which returns a new copy of the object<br />

<br />

e="7.71">a.x = 5; // modifies the object a a.x = 5; // modifies the object<br />

e="7.71"><br />

.x <br />

es c to be a pointer to a<br />

ject (initially<br />

ned; could point anywhere)<br />

e="7.71"><br />

oo();<br />

c to reference a new Foo object<br />

e="7.71"><br />

c;<br />

d to reference the same object as c<br />

e="7.71"><br />

es the object referenced by c<br />

e="7.71"><br />

// invokes Foo::bar() for a<br />

; // invokes Foo::bar() for *c<br />

e="7.71"><br />

->x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!