150k views
4 votes
Which of the following operator(s) are overloaded by default method, if the programer does not provide one? operator= operator== operator-- All of the above None of these Class

User Mpavlov
by
8.8k points

1 Answer

3 votes

None of these operators are overloaded by default methods. In C++, the assignment operator (operator=) and the equality operator (operator==) must be explicitly overloaded if the programmer wants to define custom behavior for these operators in a class. Similarly, the decrement operator (operator--) also needs to be explicitly overloaded if desired. If the programmer does not provide custom implementations for these operators, the default behavior will be applied, which is typically a member-wise assignment for operator=, a member-wise comparison for operator==, and a decrement of the value for operator--.

User Nasruddin
by
8.9k points