Java Authenticator setDefault() MethodThe setDefault() method of Authenticator class sets the authenticator that is used by the networking code when a proxy or an HTTP server asks for authentication. Syntax:Parameter:a - The authenticator to be set. If a is null, then any previously set authenticator is removed. Return:The InetAddress of the site requesting for authorization, or null if it is not available. Throw:SecurityException Example 1Test it NowOutput: Port info ::-1 URL :null // source code of https://www.javatpoint.com is printed. Example 2Test it NowOutput: URL info :null Protocol:https // source code of https://www.javatpoint.com is printed. Next Topic# |
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