Classes and Objects
“Can't make static reference to method void sayHello() in class test.”
Why? The answer lies in the difference between objects and classes. As noted in previous slides, classes are composed of member objects, primitives and methods. When properly designed, classes provide state and behavior for objects.
As and OO language, Java emphasizes the use of objects to manipulate data. Thus, we must make instances of a class in order to drive a program.