Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aula3pratica1;
- public class Conta
- {
- static int totContas;
- static double valorTotalContas;
- String nomeBanco;
- String nomeGerente;
- /**public void contas(int totContas, double valorTotalContas,String nomeBanco, String nomeGerente)
- {
- this.nomeBanco= nomeBanco;
- this.nomeGerente = nomeGerente;
- }
- */
- public static int getTotContas()
- {
- return totContas;
- }
- public static void setTotContas(int totContas)
- {
- Conta.totContas = totContas + 1;
- }
- public static double getValorTotalContas()
- {
- return valorTotalContas;
- }
- public static void setValorTotalContas(double valorTotalContas)
- {
- Conta.valorTotalContas = valorTotalContasA;
- }
- public String getNomeBanco()
- {
- return nomeBanco;
- }
- public void setNomeBanco(String nomeBanco)
- {
- this.nomeBanco = nomeBanco;
- }
- public String getNomeGerente()
- {
- return nomeGerente;
- }
- public void setNomeGerente(String nomeGerente)
- {
- this.nomeGerente = nomeGerente;
- }
- }
- package aula3pratica1;
- public class Principal
- {
- public static void main(String[] args)
- {
- Conta c1 = new Conta();
- c1.setNomeBanco("Banco A");
- c1.setNomeGerente("Gerente A");
- Conta.setTotContas(2);
- Conta.setValorTotalContas(1200);
- System.out.println("Nome Banco:" + c1.nomeBanco + "\nNome Gerente: " + c1.nomeGerente
- + "\nTotal de Contas:" + Conta.totContas + "\nValor Total:" + Conta.valorTotalContas);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment