Java URL getRef() MethodThe getRef() method of URL class returns the anchor(reference) of the URL or the null if not exist . SyntaxReturnsThe anchor (also known as the "reference") of this URL, or null if one does not exist Example 1Test it NowOutput: Url reference is : getRef-- The mime type is : text/html Example 2Output: Enter Url https://docs.oracle.com/javase/9/docs/api/java/net/URL.html#getRef-- The reference of the given url is : getRef-- file: /javase/9/docs/api/java/net/URL.html appended file: /javase/9/docs/api/java/net/URL.html#getRef-- 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