oop
Pass parameters to the constructor as opposed to methods other than the constructor?
I\'m new to OOP and just wanted to know, within a class, when should you pass parameters to the constructor as opposed to methods other than the constructor?[详细]
2023-04-11 02:05 分类:问答Object Model for complex Calculator [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing th[详细]
2023-04-11 01:52 分类:问答Syntax error: Array of Vectors in OO C++
I\'ve got an outline of a HashTable class I\'m trying to make.I\'m getting 3 errors output from Visual Studio, but I can\'t see the problem here.I\'m fairly new to OO in C++ so it\'s probably somethin[详细]
2023-04-11 01:49 分类:问答Constructor takes two Integers and they must not equal, whats the best way to implement this?
public MyClass(Integer userId, Integer otherId) { if(!userId.equals(otherId)){ this.userId = userId; this.otherId = otherId;[详细]
2023-04-11 00:29 分类:问答Simple object-oriented exercises for grasping the basics [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2023-04-11 00:02 分类:问答Why should I use protected variables(members/property) with Inheritance? What are the advantages of using it?
I was going through code samples of Begining C# 3.0 and followed the sample code along. When I have created a public/protected method then I was able to access that method using the object of derived[详细]
2023-04-10 23:54 分类:问答PHP Custom templating class [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2023-04-10 23:54 分类:问答Late binding for const attributes in C++ classes?
I know there is no late binding for class attributes. But i need a good pattern to do this: #include <cstdlib>[详细]
2023-04-10 22:15 分类:问答templated typedefs and inheritance
I want to have a typedef in my base class to be specialized to each class derived from this base class. code:[详细]
2023-04-10 21:39 分类:问答Call method from instance
Let\'s say I have two classes, A and B, in turn have some methods, something() and nothing() and an instance of B is created in A, as[详细]
2023-04-10 20:46 分类:问答