import java.io.* ; import java.util.* ;
class Persona
{
private int peso , altz ;
//I costruttori si possono omettere.
public void setAltezza(int x) { altz = x ; } public int getAltezza() { return altz ; }
//...
}
class Main
{
public static void main( String[] args ) throws Exception //Le funzioni di I/O generano eccezioni.
{
Vector<Persona> persone = new Vector();
persone.add( new Persona() ) ; persone.add( new Persona() ) ;
// Prepara lettura.
BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) ) ;
System.out.print( "Altezza persona 1: " );
persone.elementAt(0).setAltezza( Integer.parseInt( in.readLine() ) ) ; // Lettura e assegnazione (set).
//...
System.out.println( "Altezza persona 1: " + persone.elementAt(0).getAltezza() ) ; // Prelievo (get) e stampa.
//...
}
}