package Upskills_Training.Variables; public class HideButton { private boolean isPasswordVisible; // To track the state of the password visibility private String password; // To store the user's password private static final String HIDE_ICON = "hide_icon.png"; private static final String SHOW_ICON = "show_icon.png"; public HideButton(String password) { this.password = password; this.isPasswordVisible = false; // Initially, the password is hidden this.isPasswordVisible = true; // the password is now visible set } public void toggleButtonVisibility() { isPasswordVisible = !isPasswordVisible; if(isPasswordVisible) { System.out.println("password is now visible " + password); System.out.println("displaying icon " + SHOW_ICON); } else { System.out.println("password is now hide "); System.out.println("displaying icon " + HIDE_ICON); } } public static void main(String[] args) { HideButton hideButton = new HideButton("abc123"); hideButton.toggleButtonVisibility(); } }