Question: class CustomerTest { public static void main ( String [ ] args ) { Customer c 1 = new Customer ( user ,

class CustomerTest {
public static void main(String[] args){
Customer c1= new Customer("user","pass");
c1. setUserName("Java");
outputName();
}
public static void outputName(Customer cust){
System. out.println("Name: "+ cust.getUserName());
}
}
The instance c1 is not in scope in the method outputName().
The instance c1 needs to be declared in outputName()
The c1 should be returned as a return value from outputName().
The c1 should be declared at the class level to be accessed in the outputName() method.
The c1 should be passed into the outputName() method as a parameter.
 class CustomerTest { public static void main(String[] args){ Customer c1= new

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!