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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:58:38+00:00 2026-06-08T21:58:38+00:00

I am trying to call my Person class constructor from my Resident class Person:

  • 0

I am trying to call my Person class constructor from my Resident class

Person:

public class Person
{
    private String name;
    private String surname;
    private String address1;
    private String address2;
    private String telephone;
    private String faxNumber;

    Person(String aName, String aSurname, String aAddress1, String aAddress2, String aTelephone, String aFaxNumber)
    {
        name = aName;
        surname = aSurname;
        address1 = aAddress1;
        address2 = aAddress2;
        telephone = aTelephone;
        faxNumber = aFaxNumber;
    }

Resident:

public class Resident : Person
{
    private String IDNumberPrim;
    private String IDNumberSec1;
    private String IDNumberSec2;
    private String IDNumberSec3;
    private String IDNumberSec4;
    private String tempID;
    private String passportNumber;


    Resident(String aIDNumberPrim, String aIDNumberSec1, String aIDNumberSec2, String aIDNumberSec3, String aIDNumberSec4, String aTempId, String aPassportNumber)

I have tried the base command, but it never works.

Please help!!!

————UPDATE—————-

Problem solved.

Thanks for all the help and suggestions

  • 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-08T21:58:40+00:00Added an answer on June 8, 2026 at 9:58 pm

    You should add the public keyword for the constructor, if you want it’s access to be public:

    public Person(String aName, String aSurname, String aAddress1,
                  String aAddress2, String aTelephone, String aFaxNumber)
    {
        ...
    }
    

    You could also use internal if they are on the same project, or protected, since one is a base of the other, etc, but it all depends on what you really want to access modifier for the ctor to be.

    The default access modifier is private, which does not allow anything from outside that class access that.

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

Sidebar

Related Questions

I'm trying to follow the code from the django docs: class Person(models.Model): name =
I'm trying to call a method from another class with a simple button in
I'm trying to call a function present in one class from another class by
I'm trying to call a @Cacheable method from within the same class: @Cacheable(value =
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
Im trying to call a method that will add or subtract 1 from a
I am trying to call c# function from javascript the code i have tried
I'm trying to write a test for this class its called Receiver : public
I have a fairly simple class that looks like this: class Person { public:
I'm trying to call my custom tag from the JSTL tag <c:url> . Because

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.