Java Class getName() MethodThe getName() method of java Class class is used to get the name of the entity, and that entity can be class, interface, array, enum, method, etc. of the class object.
SyntaxParameterNA ReturnsEntity name as the string. ThrowsDoes not throw an exception. Example 1Test it NowOutput: The Class Name = ClassgetNameExample1 Example 2Test it NowOutput: Name of the method: main Name of the method: setManyValuesMethod Name of the method: setValueMethod Name of the method: getValueMethod Name of the method: wait Name of the method: wait Name of the method: wait Name of the method: equals Name of the method: toString Name of the method: hashCode Name of the method: getClass Name of the method: notify Name of the method: notifyAll 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