Ir para conteúdo
Fórum Script Brasil

OkumuraRIn123

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que OkumuraRIn123 postou

  1. escrevi este código ele apresenta um erro quando tento compilar // DuasBolas.java public class DuasBolas { public static void main(String args[]) { // Instanciando um objeto DuasBolas bola1 = new DuasBolas(); //Armazenando valores nos atributos do objeto bola1.raio = 0.34f; bola1.oca = false; bola1.cor = 10; bola1.material= 33; // Instanciando um outro objeto DuasBolas bola2 = new DuasBolas(); // Armazenando valores nos atributos do outro objeto bola2.oca = true; bola2.material = bola1.material; // Usando valores armazenado bola2.raio = 5 * bola1.raio; bola2.material = bola1.cor+1; System.out.println("Bola1 : "); System.out.println(" raio = " + bola1.raio ); System.out.println(" oca = " + bola1.oca ); System.out.println(" cor = " + bola1.cor ); System.out.println("Bola2 : "); System.out.println(" raio = " + bola2.raio ); System.out.println(" oca = " + bola2.oca ); System.out.println(" cor = " + bola2.cor ); } } este é o erro .\DuasBolas.java:8: error: cannot find symbol bola1.raio = 0.34f; ^ symbol: variable raio location: variable bola1 of type DuasBolas .\DuasBolas.java:9: error: cannot find symbol bola1.oca = false; ^ symbol: variable oca location: variable bola1 of type DuasBolas .\DuasBolas.java:10: error: cannot find symbol bola1.cor = 10; ^ symbol: variable cor location: variable bola1 of type DuasBolas .\DuasBolas.java:11: error: cannot find symbol bola1.material= 33; ^ symbol: variable material location: variable bola1 of type DuasBolas .\DuasBolas.java:15: error: cannot find symbol bola2.oca = true; ^ symbol: variable oca location: variable bola2 of type DuasBolas .\DuasBolas.java:16: error: cannot find symbol bola2.material = bola1.material; ^ symbol: variable material location: variable bola2 of type DuasBolas .\DuasBolas.java:16: error: cannot find symbol bola2.material = bola1.material; ^ symbol: variable material location: variable bola1 of type DuasBolas .\DuasBolas.java:18: error: cannot find symbol bola2.raio = 5 * bola1.raio; ^ symbol: variable raio location: variable bola2 of type DuasBolas .\DuasBolas.java:18: error: cannot find symbol bola2.raio = 5 * bola1.raio; ^ symbol: variable raio location: variable bola1 of type DuasBolas .\DuasBolas.java:19: error: cannot find symbol bola2.material = bola1.cor+1; ^ symbol: variable material location: variable bola2 of type DuasBolas .\DuasBolas.java:19: error: cannot find symbol bola2.material = bola1.cor+1; ^ symbol: variable cor location: variable bola1 of type DuasBolas .\DuasBolas.java:21: error: cannot find symbol System.out.println(" raio = " + bola1.raio ); ^ symbol: variable raio location: variable bola1 of type DuasBolas .\DuasBolas.java:22: error: cannot find symbol System.out.println(" oca = " + bola1.oca ); ^ symbol: variable oca location: variable bola1 of type DuasBolas .\DuasBolas.java:23: error: cannot find symbol System.out.println(" cor = " + bola1.cor ); ^ symbol: variable cor location: variable bola1 of type DuasBolas .\DuasBolas.java:25: error: cannot find symbol System.out.println(" raio = " + bola2.raio ); ^ symbol: variable raio location: variable bola2 of type DuasBolas .\DuasBolas.java:26: error: cannot find symbol System.out.println(" oca = " + bola2.oca ); ^ symbol: variable oca location: variable bola2 of type DuasBolas .\DuasBolas.java:27: error: cannot find symbol System.out.println(" cor = " + bola2.cor ); ^ symbol: variable cor location: variable bola2 of type DuasBolas 17 errors error: compilation failed Poderiam me ajudar? já fiz de td e não consegui resolver
×
×
  • Criar Novo...