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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:17:08+00:00 2026-06-12T21:17:08+00:00

In my program I have 4 classes like the following: class Bank class Branch

  • 0

In my program I have 4 classes like the following:

  • class Bank
  • class Branch extends Bank
  • class Customer extends Branch
  • class Loan extends Customer

If I want to add a Customer, then I give all the parameters from main function. like:

customer(bank name, bank add, branch number, brunch add, customer info...)

From this constructor, bank’s information goes to the Bank class via both Customer and Branch constructors using super() and so on.

The problem is when I created the Loan, class extending the Customer class, then I didn’t use any constructor, and I don’t want to use it too, because I want only one variable from the Customer class. But my compiler showing this error, it is saying to use a constructor for taking all the parameters for Bank, Branch, and Customer‘s constructors.

How can I solve this problem without using any constructor in the Loan class?

  • 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-06-12T21:17:09+00:00Added an answer on June 12, 2026 at 9:17 pm

    The simplest way to avoid using the Customer constructor in the Loan class is to not extend Customer. When deciding what class to extend, if any, you should use the “is a” test. For example, a Branch is a Bank, so it makes sense to have class Branch extends Bank. However, Loan is a Customer doesn’t really make sense, so you shouldn’t do class Loan extends Customer. On the other hand, a Customer has a Loan; in fact, a Customer may have more than one Loan or none at all. This means that it makes sense to have a Loan member variable (or perhaps a List of Loans, if you have learned about the Container API) in the Customer class.

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

Sidebar

Related Questions

OK so I have the following classes in C#: class Program { static void
Let's say I have two classes like the following: Class A { public: ..
I want to program something in both C# and F#. I have partial classes
I have a program with about 8 Activity classes, and 1 Application class. I
In a C++ program I have two classes (structs) like struct A { int
I have the following classes: type TSong = class(TObject) private FArtist: String; FTitle: String;
I have 3 classes like: public class Animal { ... all sort of data
I have the following POCO classes: public class Location { public int LocationId {
In my program I have two classes: Collector and Entity. Collector stores Entities in
In my program I have numerous Entity classes with a Texture2D attribute that are

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.