Potete aiutarmi a capire dove sbaglio:
Quanti oggetti al massimo possono essere deallocati
all’uscita del metodo m? Il risultato è 6 ma io mi trovo 5 come in figura
Quanti oggetti al massimo possono essere deallocati
all’uscita del metodo m? Il risultato è 6 ma io mi trovo 5 come in figura
Java:
public class Currency {
String name = new String();
static Integer value = new Integer();
static void getCurrency(Integer v) {
Currency c = new Currency();
c.value = v;
}
public static void m() {
Currency.getCurrency(50);
Currency.getCurrency(100);
}
public static void main(String[] argv){
Currency.m();
}
}
Ultima modifica: