December 2008
Intermediate to advanced
1088 pages
26h 55m
English
1.1 The printStackElements() method of the PrintableCharStack class does not pop the elements.
//Filename: PrintableCharStack.javapublic class PrintableCharStack extends CharStack { // (1) // Instance method public void printStackElements() { // (2) for (int i = 0; i <= topOfStack; i++) System.out.print(stackArray[i]); // print each char on terminal System.out.println(); } // Constructor calls the constructor of the superclass explicitly. PrintableCharStack(int capacity) { super(capacity); } // (3)}//Filename: Client.javapublic class Client { public static void main(String[] args) { ...
Read now
Unlock full access