0
- Create a Client class, considering that it should have : Builder You must have the default constructor and a constructor that must only have the Client code as its parameter.
Attributes
• Client Code
• Full Name
Methods
• Insertion of client name
• Returns from client name
• Returns Client Code
Then Create a program that instantiates two Client objects, assign the value to the Client Name attribute. Before and after assignment, print the Customer Name using the return function.
My question is when he says : "Before and after assignment, print the Customer Name using the return function.", and print the name before the 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 the 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();
}
}
You missed the setClient() in your Client model. So, before you assign the data that the "user" will type, give a system.out.print.
– Júlio César Baltazar
I put the setCliente(), but where do I give a system.out.print exactly? , can you exemplify me with the code? so it’s kinda hard to understand , I’m beginner kkk
– italo vinicius
can yes, I’m doing here an answer.
– Júlio César Baltazar