Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:28:41+00:00 2026-05-31T16:28:41+00:00

So my task may sound simple, but it has me boggled. I have looked

  • 0

So my task may sound simple, but it has me boggled.
I have looked through code on the internet, but I cannot get to grips with. Neither can I
get to grips with the slides my teacher posted. This is what is required from me.

Create a new runtime exception type called EmptyStackException.

However I have no clue how to make the method, class, variable or whatever needs to be made in order to fulfill the requirement.
I have a few classes that are implementations of a DynamicArrayStack and a LinkedStack. An interface for Stack.

Any pointers would be mightily helpful.

Thanks

Mjall2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:28:42+00:00Added an answer on May 31, 2026 at 4:28 pm

    Create a new runtime exception type called EmptyStackException.

    create type is done by

    public class EmptyStackException extends RuntimeException { ... }
    

    Now if only we knew what to put in this new type (a.k.a. class).
    Typically we look at the methods in the superclass and override those needing different handling. Below I have overridden some of them but delegated back to the existing class. No need to do this if you don’t need to make any changes in behavior.

    public class EmptyStackException extends RuntimeException {
          public EmptyStackException() {
              super();
          }
          public EmptyStackException(String s) {
              super(s);
          }
          public EmptyStackException(String s, Throwable throwable) {
              super(s, throwable);
          }
          public EmptyStackException(Throwable throwable) {
              super(throwable);
          }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a simple task but at the moment I really have no
This may sound like noobish question but I have tried researching these two classes
My title may make my question sound confusing, but it is not. I have
This seems like a simple task but there may be an easier way. I
In php files, this task may be a simple include of another file but
Task at hand — I have three versions of some code, developed by different
I know this may sound silly, but I'd like to put a version in
This may sound totally stupid, but is a case of real life :( I'm
I have the following task: There is string, and it may have any length:
I know this question may sound silly, but I am learning (at least trying)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.