2.1 Nothing new

Data abstraction is nothing new. We already use it in most high level programming languages. Think of the type int.

Do you have to think of the internal signed representation when you are writing a program?

Do you have to express how to multiply two integers?

Do you have to express how to cast a long integer to a short integer?

All the details of ``how ... is done'' is hidden from an average C programmer. When you specify a short signed integer on the right hand side of an assignment, and a long signed integer on the left hand side, code is automatically generated to extend the sign bit. You don't have to worry about it.

As far as you are concerned, an int object is one that can be added, subtracted, multiplied, divided, assigned, and etc.



Copyright © 2006-09-07 by Tak Auyeung