How is Java inheritance used? in the extends option I have an error to inherit another object

0
class CarroToyota extends carroBMW
 {
     public CarroToyota () {
         modelo= "Toyota";
     }
 } 

The upper part says that it is correct but at the moment of importing another class it says that I have an error in ca.modelo:

import paquete.carroBMW.CarroToyota;
class Main2 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        CarroToyota ca;
        ca=new CarroToyota();
        ca.modelo;
    }
}
    
asked by Redes del Hack 07.08.2017 в 00:36
source

0 answers