Fall Semester 2016


Previously on C212: Using Objects
When we are being given problems, we think of ways to solve them by designing algorithms (computational avenues to reaching our goals). Like mathematicians we aim for complete and correct solutions to our problems. Then we code them in. That's where the science part comes in, with all the errors (hard to find, but easy to fix). During this part we learn a lot about ourselves, not just about our tool, the language Java. Java is an object-oriented language. From the very beginning we run into, can't avoid, and have to use objects. However at the very outset we learn about local variables and primitive types. As soon, however, as we need to use Strings we start to see the true nature of objects: they can do things, they don't just are things. So we explore (that is, learn about, and invoke) some instance methods, constructors, and find out why some instance methods are called accessors and some mutators (through this example). Often times we wrote a test program. We spend a fair amount of time online when we learn about new objects (APIs). Finally we learn that in Java we have (a) primitive types, and (b) reference types (also known as user-defined types, classes or, by extension, objects). This simple test explains the name (i.e.,reference). Java does have pointers, it just doesn't have pointer arithmetic. We stop and take a deep breath.

Updated by Adrian German for C212/A592