RU beehive logo ITEC dept promo banner
ITEC 120
2009spring
ibarland
nokie
jmdymacek

homeinfolectslabsexamshws
textbooktutor/PIsjava.lang docsjava.util docs

lect02c
objects: state + methods

We have worked with calling String methods, like length, replace, etc.. Today we will explore the idea that objects are data which have two things:

Let's work with an example, and come back to the concept of "object".

We'll use objects of the type java.awt.Rectangle.

In general, we say that an object has state (its internal information: in this case, the x,y location of its NW corner, its width, and its height), and behaviors (the methods

Here are some terms for the same thing. You will need to know that objects = state + behaviors, although you can use any of the rows below:

object-oriented term state behaviors
math term data functions1
Java term fields methods

Next time we'll talk about writing tester-programs, and have another example of objects with state.

Friday we'll talk about interfaces, and signatures.

Starting next Monday, we'll actually write a program where we make our own class of objects, with whatever state and behaviors we want!


1More precisely, people use the term “functions” only for methods which return an answer (like getters) and instead they use the term “procedure” to mean void methods (like mutators).      

homeinfolectslabsexamshws
textbooktutor/PIsjava.lang docsjava.util docs


©2009, Ian Barland, Radford University
Last modified 2009.Feb.02 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme