Advertisement
cesarnascimento

poo loiane aula 24 classe

Aug 22nd, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. //classe
  2.  
  3.  
  4. public class Carro {
  5.    
  6.     String marca;
  7.     String modelo;
  8.     int numPassageiros;
  9.     double capCombustivel;
  10.     double conCombustivel;
  11.    
  12. }
  13.  
  14. // main
  15.  
  16. public class TesteCarro {
  17.  
  18.     public static void main(String[] args) {
  19.  
  20.         Carro van = new Carro();
  21.        
  22.         van.marca = "Fiat";
  23.         van.modelo = "Ducato";
  24.         van.numPassageiros = 10;
  25.         van.capCombustivel = 100;
  26.         van.conCombustivel = 0.2;
  27.        
  28.         System.out.println(van.marca);
  29.         System.out.println(van.modelo);
  30.        
  31.     }
  32.     /* César N. */
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement