In java, many modifiers are there, those are:


1) private
2) protected
3) public
4) default
5) Abstract
6) Final
7) Synchronised
8) Volatile
9) Static
10) Native
11) Transient


default is not a keyword. If you don’t specify any modifier, then it is considered as default . to get modifier of a class or interface, getModifiers() method is given in java.lang.Class . this method returns int value. We have to pass this int value to toString(int) method of a java.lang.reflect.Modifier. see the following example

package com.java;
import java.lang.reflect.Modifier;

public class Sample 
{
    public static void main(String[] args) throws Exception
    {
        Class c=Class.forName("com.java.Sample");
        int i=c.getModifiers();
        System.out.println(Modifier.toString(i));
    }
}

/*

 Output : public

 */