hi, i need someone to look at my homework and give me comment where and how should i begain with.

Choose one of the stack implementations and implement a method with this specification:

Object itemAt (int n)
//precondition: 0<=n and n<size()
//postcondition: the return value is the item that is n from the top (with the top at n=0, the next at n=1 and so on). The stack is not changed

Throw a NoSuchElementException if the precondition is violated from (java.util.NoSuchElementException).

Recommended Answers

All 2 Replies

Member Avatar for iamthwee

try explaning wat that means with example.

I have no idea wat they want u 2 do.

God bless.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.