Java Class getModifiers() MethodThe getModifiers() method of java Class class returns the Java language modifiers for this class or interface. The modifiers contain the Java Virtual Machine's constants for the public, protected, private, final, static, abstract and interface. SyntaxParameterNA ReturnsThe integer representing the modifiers for this class. ThrowsDoes not throw an exception. Example 1Test it NowOutput: Class Modifier = public Example 2Test it NowOutput: Sample1 Constructor calling Class ClassgetModifiersExample2 Modifier = public Class Sample1 Modifier = Next TopicJava Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India