Question
Complete the implementation of the LinkedStack class by implementing the peek(), isEmpty(), size() and toString() method. Design and create a class named Painting. Test all
-
Complete the implementation of the LinkedStack class by implementing the peek(), isEmpty(), size() and toString() method.
-
Design and create a class named Painting.
-
Test all the methods in the Painting class as well as those in LinkedStack. You must test the Painting methods through objects on the on the Stack, not as an object itself.
-
Include Javadoc in StackInterface, and generate Javadoc so that you have the doc folder in your project.
-
Use the logically correct packaging structure to group your classes.
-
Implement the toString method of StackInterface correctly. When used, it should print out the top element first and the bottom element last. Must test the toString method several times to show that it is not obliterating the stack.
-
Use the following code as a base.
LinkedStack Class
package stack;
import exception.StackException;
public class LinkedStack
public void push(T element) { LinearNode
StackException Class
package exception;
public class StackException extends RuntimeException { public StackException(){ super("The stack is empty"); } public StackException(String msg) { super(msg); }
} StackInterface
package stack;
import exception.StackException;
public interface StackInterface
}
LinearNode Class
package stack;
public final class LinearNode
} Painting Class:
Objectives:
Successful and correct implementation of the Painting Class
Test all six methods of the Stack implementation: pop, push, isEmpty, toString, size, peek using the two stack of your own classes.
Test all the methods in the Painting class you created yourself through the LinkedStack object.
Implementation of the six methods in the Stack class.
pop, push, isEmpty, size, peek. toString
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started