Java URL toString() MethodThe toString() method of URL class constructs a string representation of this URL. The string is created by calling the toExternalFile() method of the stream protocol handler for this object. SyntaxOverridestoString in class Object ReturnsA string representation of this object. Example 1Test it NowOutput: The given url is : https://www.javatpoint.com/java-tutorial User information of given url is : https://www.javatpoint.com/java-tutorial Example 2Output: Given URL is : https://www.javatpoint.com/URL-class File name in given url : URL-class Next TopicJava URL 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