Class toGenericString() method in Java with Examples
The toGenericString() method of java.lang.Class class is used to convert the instance of this Class to a string representation along with the information about the modifiers and type parameters. This method returns the formed string representation.
public String toGenericString()
Parameter: This method does not accept any parameter.
Return Value: This method returns the String representation of this object.
Below programs demonstrate the toGenericString() method.
Class represented by c1: public final class java.lang.String
Class represented by c2: int Class represented by c3: void