1
public class ClassDemo
2

{
3
public ClassDemo()
{}
4
5
public static void main(String[] args)
6
{
7
ClassDemo test=new ClassDemo();
8
System.out.println("The class of test is:"+test.getClass().getName());
9
try
{
10
Class c=Class.forName("java.lang.Object");
11
System.out.println(c.getPackage()+"\t");
12
System.out.println(c);
13
java.lang.reflect.Method[] m=c.getMethods();
14
System.out.println("The element in String[] is:"+String[].class.getComponentType());
15
System.out.println((new int[3][4][5][6]).getClass().getName());
16
System.out.println("The method defined in Object class:");
17
for(int i=0; i<m.length; i++)
18
{
19
System.out.println(m[i]);
20
}
21
}
22
catch(ClassNotFoundException e)
23
{
24
e.printStackTrace();
25
}
26
}
27
}