Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I would like to create a login feature with Java, where userID is HelloWorld & pwd is hello123. if login success, print Welcome, but if
I would like to create a login feature with Java, where
userID is HelloWorld & pwd is hello123.
if login success, print "Welcome", but if is unsuccessful, print "Invalid username or password".
Thank you :)
1 2 public class Clerk { 3 private String userID; 4 private String pwd; 5 6@ public Clerk (String userID, String pwd) { 7 super(); 8 this.userID = userID; 9 this.pwd = pwd; 10 } 11 120 public String getUserID() { 13 return userID; 14 } 15@ public void setUserID(String userID) { 16 this.userID = userID; 17 } 180 public String getpwd() { 19 return pwd; } 210 public void setpwd (String pwd) { 22 this.pwd = pwd; 23 } 24 } 25 |Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started