Java Code Examples for java.lang.reflect.Modifier.STRICT

The following are Jave code examples for showing how to use STRICT of the java.lang.reflect.Modifier class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: openjdk-jdk10   File:   Source Code and License Vote up 6 votes
public static void main(String [] argv) {
    int allMods = Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE |
        Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL |
        Modifier.TRANSIENT | Modifier.VOLATILE | Modifier.SYNCHRONIZED |
        Modifier.NATIVE | Modifier.STRICT | Modifier.INTERFACE;

    String allModsString = "public protected private abstract static " +
        "final transient volatile synchronized native strictfp interface";

    /* zero should have an empty string */
    testString(0, "");

    /* test to make sure all modifiers print out in the proper order */
    testString(allMods, allModsString);

    /* verify no extraneous modifiers are printed */
    testString(~0, allModsString);