Attributes
• Customer Code
• Full Name
Methods
• Insertion of customer name
• Returns the name of the client
• Returns Customer Code
Next Create a program that instantiates two Client objects by assigning the value to the Client Name attribute. Before and after the assignment, print the Client Name using the return function.
My question is when it says: "Before and after the assignment, print the Client Name using the return function." , how to print the name before assignment? >
My code:
Client Class
package Questao7;
public class Cliente {
int codigo;
String nome ;
//contrutor com o parâmetro código
public void Cliente(int codigo){
}
public String getNome(){
return nome;
}
public int getCodigo(){
return codigo;
}
}
Instantiating objects in the Main Method, Is incomplete because of my doubt:
package Questao7;
import java.util.Scanner;
public class Teste04 {
public static void main(String[]args){
Scanner input=new Scanner(System.in);
Cliente c1= new Cliente();
Cliente c2= new Cliente();
}
}