15.01.2013 Views

Education in Programming David Gries Dr. rer ... - Cornell University

Education in Programming David Gries Dr. rer ... - Cornell University

Education in Programming David Gries Dr. rer ... - Cornell University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Teach<strong>in</strong>g OO requires a suitable model of classes and objects<br />

public class C {<br />

<strong>in</strong>t x;<br />

}<br />

public C(<strong>in</strong>t xx) {<br />

x= xx;<br />

}<br />

public getX() {<br />

return x;<br />

}<br />

Allows one to<br />

dispense with<br />

terms like po<strong>in</strong>ter<br />

and reference,<br />

which students<br />

don’t understand<br />

and which<br />

complicate<br />

Pr<strong>in</strong>cipal: Introduce and discuss concepts<br />

at the appropriate level of abstraction<br />

Pr<strong>in</strong>cipal: <strong>in</strong>troduce names<br />

for items to be discussed.<br />

11<br />

v a0<br />

a0<br />

toStr<strong>in</strong>g() { ... }<br />

x 45<br />

C(<strong>in</strong>t) { ... }<br />

getX() { ... }<br />

Object<br />

C<br />

11

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

Saved successfully!

Ooh no, something went wrong!