logo

Crowdly

Browser

Add to Chrome

Quelle est la sortie de ce programme (Pile générique)? import java.util.Stac...

✅ 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());

}

}

More questions like this

Want instant access to all verified answers on moodle.myefrei.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome