Java
Jump to navigation
Jump to search
Sample Program
Class Test {
public static void main(String[] args) {
for (int i = 0; i < args.length; i++)
System.out.print(i = 0 ? args[i] : " " + args[i]);
System.out.println();
}
}
Miscellaneous
- Class Literal
- A class literal is an expression consisting of the name of a class, interface, array, or primitive type followed by a
.
and the tokenclass
. The type of a class literal isClass
. It evaluates to the Class object for the named type (or for void) as defined by the defining class loader of the class of the current instance. - Eg:
public class MyClass //...
//...
printf ("Class name is %s\n",MyClass.class.getName());