MyClass.java Source code

Java tutorial

Introduction

Here is the source code for MyClass.java

Source

class MyClass {
    public MyClass() {
        System.out.println("called");
    }
}

public class Main {
    public static void main(String[] args) throws InstantiationException {
        Class<MyClass> personClass = MyClass.class;
        try {
            MyClass p = personClass.newInstance();
            System.out.println(p);
        } catch (InstantiationException | IllegalAccessException e) {
            System.out.println(e.getMessage());
        }
    }
}