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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:09:39+00:00 2026-05-14T15:09:39+00:00

Objects with the same attributes and methods belongs to the same class? Can’t I

  • 0

Objects with the same attributes and methods belongs to the same class?

  1. Can’t I declare two identical classes with the same methods and attributes, instanciate them and have “objects with the same attributes and methods belonging to different classes“?

  2. Can’t I declare a class A and a sub-class B (children of the class A) both with the same methods and attributes (and don’t declare any new attribute or method on the class B), instanciate them and have “objects with the same attributes and methods belonging to different classes“?

This question is not about good practices… It’s about the logical value (true or false) of the question on the title.

  • 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-14T15:09:40+00:00Added an answer on May 14, 2026 at 3:09 pm

    You don’t specify what language(s) you’re talking about; perhaps there’s some exotic language that has the property you describe, but at least in languages like Java and C++ there’s no concept of inferring that two classes are “the same” based on what methods/instance variables they declare.

    So, the answer is “no, they are not the same class, even though they look the same”.

    The sub-class case is a little different: if you declare B as a subclass of A (without adding any methods or variables), they are still different classes, but an object of class B also “is-a” A, because of normal inheritance rules.

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

Sidebar

Related Questions

I have two objects of the same class (Model) type. I want to check
I have many objects reference the same class of stored data. In previous programs,
Suppose that I have two objects with the same property name that I am
I can define an object and assign attributes and methods: class object: def __init__(self,a,b):
I'm working on a project where I have a bunch of objects (same type)
Hello I have 2 lists that contains the same objects. I would like to
I have created total 50 test scripts. All these scripts use almost same objects
How to serialize Multiple Objects of the same Class into a single file and
I have a collection of objects of the same type, let's call it DataItem
I have two models Customer and Referal. Both have an email attribute. Referal belongs

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.