Question: google doc with code https://docs.google.com/document/d/1S1yhXsTB2PsA9ZOxgtO5KPH0udR3VI6qf7_6jY88cnM/edit?usp=sharing A. Replace stack of Object with the generic class Stack . B. Replace queue of Object with the generic class

google doc with code

https://docs.google.com/document/d/1S1yhXsTB2PsA9ZOxgtO5KPH0udR3VI6qf7_6jY88cnM/edit?usp=sharing

A. Replace stack of Object with the generic class Stack. B. Replace queue of Object with the generic class LinkedList. C. Replace Post.toString() method with a for-each loop. D. Replace exception classes with the following exception class. E. Remove all unnecessary type casts.

--------------

import java.util.*;

public class Stack extends Vector { public Stack(); // constructor public Boolean empty(); public E peek(); public E pop(); public E push(E item); }

------------

public class LinkedList extends AbstractSequentialList implements List, Queue, Cloneable, Serializable { public LinkedList(); // constructor public E getFirst(); public E removeFirst(); public void addLast(E item); public Boolean isEmpty(); }

----------

enum errorType { ExcessLeftParenthesis, ExcessRightParenthesis, ExcessOperator, ExcessOperand}; class infixException extends Exception { private errorType etype; public infixException(errorType et) { // constructor etype = et; } public String toString() { return etype.name(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!