Java Authenticator getPasswordAuthentication() Method

The getPasswordAuthentication() method of Authenticator class is called when password authorization is needed. The subclasses must override the default implementation, of getPasswordAuthentication() which returns null.

Syntax:

Parameter:

No parameter is passed.

Return:

The Password Authentication collected from the user, or null if none is provided.

Throw:

Does not throw any Exception

Example 1

Test it Now

Output:

password validating...

Example 2

Test it Now

Output:

null
null





Latest Courses