CMPU-181, Spring 2013 Interactions like those seen in class March 4, 2013 Welcome to DrJava. Working directory is /Users/hunsberg/Desktop > // Class-oriented data are like global variables in Scheme, except that they belong > // to a particular class. For example, the MarchFourth class contains "variables" > // named x, str, c and dbl. > MarchFourth.x 0 > MarchFourth.x = 5 5 > MarchFourth.x 5 > MarchFourth.str = "hi there" "hi there" > MarchFourth.str "hi there" > MarchFourth.c = 'L' 'L' > MarchFourth.c 'L' > MarchFourth.dbl = 102.321 102.321 > MarchFourth.dbl * 100 10232.1 > MarchFourth.dbl 102.321 > MarchFourth.dbl + 1000.0009 1102.3219 > // Class-oriented functions (a.k.a. methods) are just like the functions we defined > // in Scheme, except that they belong to a class. So, when we "call" them, we need > // to include the class name. For example, the MarchFourth class contains a > // function called FACTY. > MarchFourth.facty(3) 6 > MarchFourth.facty(5) 120 > MarchFourth.facty(10) 3628800 > // Class-oriented functions and class-oriented data are indicated by the STATIC keyword. > // See the examples in the MarchFourth class. Each data item (or "field") is declared > // to be static. The function, FACTY, is also declared to be static. >