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 3938470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:11:18+00:00 2026-05-20T00:11:18+00:00

After making an abstract superclass, when you get to the first concrete subclass, you’ve

  • 0

After making an abstract superclass, when you get to the first concrete subclass, you’ve got to implement all your abstract methods, even if some of those methods aren’t going to be used in that concrete class. SO! Why doesn’t an abstract superclass just make those abstract methods into “fake” methods, like:

public void doThis() { 
     if (1 < 0){ 
          int x = 34
     }
}

it does nothing, since 1 is never less than 0. And then when you get to your concrete subclass, you don’t have to implement ALL those abstract methods, but for the ones that you WANT to implement you can just rewrite into a method you need it to be:

public void doThis() {
      //does "this".
}

Both ways would allow for polymorphism, right? So what are the real advantages of abstract methods that I’m missing?

Thanks!

  • 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-20T00:11:19+00:00Added an answer on May 20, 2026 at 12:11 am

    the idea is to enforce a policy that when you use an abstract class:

    a) the class that is abstract cannot be instantiated
    and
    b) you must “fill in the blanks” for how the abstract stuff is done — in other words, you need to make the abstract stuff concrete.

    We don’t need these things, but it makes design intent clear, and clean. It reduces errors. If we were to follow your approach, there would be no compile time check to make sure the ‘rules’ are being followed.

    Note that many languages, like javascript, have no notion of ‘abstract’, and people still write good software with javascript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't get this to work even after making sure to set allowScriptAccess to
After making cabal install of the darcsden code I get this message: cabal: The
EDIT: After making all the changes you suggested, the problem remained. The debugger said
I am trying to get a content appear after sometime after making an ajax
So, after making all of my calculations an AsyncTask for my app and leaving
After making the menu disappear I cannot get my content to show without listing
After making some comments , I've been inspired to get some feedback on the
I'm having trouble saving xml files after making changes to them. I've spent all
I am developing an application in that after making a web service I got
After making a gzip deflate request in PHP, I receive the deflated string in

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.