2010-09-15 9 views

risposta

10

Sì, oltre a alcuni metadati, come un indice di inizio e fine (poiché tale matrice di caratteri può essere condivisa tra stringhe, ad esempio quando si creano sottostringhe).

Guardando la fonte per java.lang.String, è vedere i seguenti campi di esemplare:

/** The value is used for character storage. */ 
private final char value[]; 

/** The offset is the first index of the storage that is used. */ 
private final int offset; 

/** The count is the number of characters in the String. */ 
private final int count; 

/** Cache the hash code for the string */ 
private int hash; // Default to 0 
+0

E alcuni metodi e algoritmi ... come 'String' è un oggetto e non un primitivo' datatype' –

+1

@Garis sì, ma quello non è il contenitore, quello è lo zucchero in cima –

Problemi correlati