Sunday, November 9, 2008

Beginning Classes in Java: Part 1



Here is an example uses a Class object to print the class name of an object. Please understand that it is NOT a part of the above video clip. It is provided for education purpose only.


void printClassName(Object obj) {
System.out.println("The class of " + obj +
" is " + obj.getClass().getName());
}