MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
java.util.List is an interface
 */
public class MainClass {
    public static void main(String[] unused) {
        try {
            String n = "java.util.List";
            Class c = Class.forName(n);

            if (c.isInterface()) {
                System.out.println(n + " is an interface");
            } else {
                System.out.println(n + " is not an interface");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

}