Java Class getCanonicalName() MethodThe getCanonicalName() method of java Class class returns the canonical name of the class as defined by the Java Language Specification. Otherwise, it returns Null. SyntaxParameterNo parameter is passed. ReturnsThe canonical name of the underlying class if it exists, otherwise Null. ThrowsDoes not throw an exception. Example 1Test it NowOutput: Class Canonical Name = ClassgetCanonicalNameExample1 Class Simple Name = ClassgetCanonicalNameExample1 Example 2Test it NowOutput: Class = ClassgetCanonicalNameExample2 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