import java.lang.reflect.*;

/**
 * A simple example that uses reflection
 *
 * @author  Computer Science Deprtment, James Madison University
 * @version 1.0
 */
public class Example1
{
    /**
     * The entry point
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args)
    {
       Class         s_Class;
       Field[]       s_Fields;
       int           i;
       Method[]      s_Methods;
       String        s;



       s = new String();

       // Get the Class of s
       s_Class = s.getClass();
       System.out.println(s_Class);


       // Get the fields/attributes  of s
       s_Fields = s_Class.getDeclaredFields();

       for (i=0; i < s_Fields.length; i++) 
       {
          System.out.println(s_Fields[i]);
       }


       // Get the methods of s
       s_Methods = s_Class.getDeclaredMethods();

       for (i=0; i < s_Methods.length; i++) 
       {
          System.out.println(s_Methods[i]);
       }
    }
}
