Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!