Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following class, what sets of statements would have the end result of the myCustomer instance having the customername as AB 1 0 0

Given the following class, what sets of statements would have the end result of the myCustomer instance having the customername as AB1002 password as test as testpassword and then outputting the customername and password?
public class Customer {
private String customerName;
private String password;
public Customer(String customerName, String password){
this.customerName = customerName;
this.password = password;
}
public String getCustomerName(){
return customerName;
}
public String getPassword(){
return password;
}
public void setCustomerName(String customerName){
this.customerName = customerName;
}
public void setPassword(String password){
this.password = password;
}
}
Customer myCustomer = new Customer();
myCustomer.setCustomerName("AB1002");
myCustomer.setPassword("testpassword");
System.out.println("Customer: "+ myCustomer.getCustomerName());
System.out.println("Password: "+ myCustomer.getPassword());
Customer myCustomer = new Customer("AB1002","testpassword");
System.out.println("Customer: "+ myCustomer.customername());
System.out.println("Password: "+ myCustomer.password());
Customer myCustomer = new Customer("AB1002","testpassword");
System.out.println("Customer: "+ myCustomer.customername);
System.out.println("Password: "+ myCustomer.password);
Customer myCustomer = new Customer("AB1002","testpassword");
System.out.println("Customer: "+ myCustomer.getCustomerName());
System.out.println("Password: "+ myCustomer.getPassword());

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago