✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Quelle est la sortie de ce programme (Pile générique)?import java.util.Stack;
class PileGeneric <E> {
private Stack <E> pile = new Stack <E>();
public E pop() {
E obj = pile.pop();
return obj;
}
public void push(E obj) {
pile.push(obj);
}
}
public class Test {
public static void main(String args[]) {
PileGeneric <String> pg = new PileGeneric <>();
pg.push("Hello");
System.out.println(pg.pop());
}
}