Visualizzazione dei risultati da 1 a 10 su 11

Visualizzazione discussione

  1. #1

    esercizio ereditarietà

    Salve a tutti,

    Volevo chiedere una consulenza su un esercizio di ereditarietà . Di seguito il codice:

    codice:
    public class Media 
    
    {
      // ATTRIBUTI
        
        private String title;
        private int year;
        
        
        // COSTRUTTORI
        
        public Media(String title, int year)
        {
            
            this.title = title;
            this.year = year;
        }
    
    
    
    
    
    
        
        // METODI
        
        public String getTitle() 
        {
            return this.title;
        }
    
    
    
    
        public void setTitle(String title) 
        {
            this.title = title;
        }
    
    
    
    
        public int getYear() 
        {
            return this.year;
        }
    
    
    
    
        public void setYear(int year) 
        {
            this.year = year;
        }
    
    ...
     public class Ebook extends Media
    
    {
       // ATTRIBUTI
        
        String genre;
        String[] authors;
        
        
        
        // COSTRUTTORI
        
        public Ebook(String genre, String[] people)
        {
            super(?)
            this.genre = genre;
            this.authors = people;
        }
    ...

    IL MIO PROBLEMA E' : COME RICHIAMO IL COSTRUTTORE DELLA SUPERCLASSE AVENDO CAMPI DI SUPERCLASSE PRIVATI E SOLO GETTERS E SETTERS PUBBLICI???


    GRAZIE
    Ultima modifica di JavaTheBest; 22-01-2014 a 17:27 Motivo: Aggiunti i tag CODE

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.