A method
leaveList(int n)
is required in the class
POSlist
, similar to the method
leaveLine(int n)
that was added to the class
POSline
.
Using object references, construct the method
public Cart leaveList(int n)
that removes the nth
CartNode
object from list. The method must return the
Cart
object in that node.
You may assume that the nth
CartNode
object exists in the
list
.
You may use any method declared or developed.