Ask Your Question
3

Is it true that constructors set identical values for two variables that are not related to each other?

asked 2023-06-11 18:52:56 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-11 19:19:02 +0000

bukephalos gravatar image

No, it is not true. Constructors initialize values to the attributes or properties of an object, and these values may or may not be related to each other. For example, a constructor for a person object may set values for attributes such as name, age, and address, which are related to the person object. However, the constructor will not set identical values for two variables that are not related to each other.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-11 18:52:56 +0000

Seen: 11 times

Last updated: Jun 11 '23