Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Main {
    public static void main(String[] argv) throws Exception {

        Class cls = java.lang.String.class;
        Method method = cls.getMethods()[0];
        Field field = cls.getFields()[0];
        Constructor constructor = cls.getConstructors()[0];
        String name;

        name = cls.getName();
        System.out.println(name);
        name = cls.getName() + "." + field.getName();
        System.out.println(name);
        name = constructor.getName();
        System.out.println(name);
        name = cls.getName() + "." + method.getName();
        System.out.println(name);
    }
}
/*
java.lang.String
java.lang.String.CASE_INSENSITIVE_ORDER
java.lang.String
java.lang.String.hashCode
*/