Pessoal na faculdade dei essa matéria e falhei miseravelmente, como não peguei de novo a matéria estou estudando por conta própria.
Este é meu código hoje>
package lasoftware;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner t = new Scanner(System.in);
Front obj1 = new Front();
System.out.println("Type client's name: ");
obj1.setNome(t.nextLine());
System.out.println("Type client's family name");
obj1.setSobrenome(t.nextLine());
System.out.println("Type client's Id");
obj1.setId(t.nextInt());
System.out.println("Type client's salary");
obj1.setSalario(t.nextDouble());
obj1.imprimir();
}
}
package lasoftware;
import java.util.Scanner;
public class Front {
Scanner t = new Scanner(System.in);
String nome,sobrenome;
int id;
double salario;
//-----------------GETTER-------------------------
public String getNome(String n) {
return n;
}
public String getSobrenome() {
return sobrenome;
}
public int getId() {
return id;
}
public double getSalario() {
return salario;
}
//-----------------SETTER-------------------------
public void setNome(String nome) {
this.nome = nome;
}
public void setSobrenome(String sobrenome) {
this.sobrenome = sobrenome;
}
public void setId(int id) {
this.id = id;
}
public void setSalario(double salario) {
this.salario = salario;
}
//------------------PRINT----------------------
public void imprimir() {
System.out.println("Client's Name: "+ nome);
System.out.println("Client's Family name: "+ sobrenome);
System.out.println("Client's Id: "+id);
System.out.println("Client's salary: "+salario);
}
}
Alguem tem algo a acrescentar? Meu objetivo é programar para android, algumas dicas de POO ou android?