Ask Question

This semester we looked at three languages (C++, Java and Python). One common rule in all three class checklists (for C++, Java and Python) was a logical equivalence (equals) function. In C+ + it was operator==; in Java it was equals; and in Python it was __eq__. Why does this rule exist in all three languages?

+1
Answers (1)
  1. 12 March, 09:50
    0
    The languages C++, Java, Python are Object Oriented Programming languages. What this means is that we create classes and then instantiate those classes. In C+ + and Java, we use the new operator to instantiate the classes. So, if we want to display some data when we try to print the instance just like we print the variables of data types like int, double, string etc, we need to define what we need to display. It is because, class are just like data types like int, double etc. But as they are defined by the developer according to his/her needs, so the developer has to define what to print when they are printed.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “This semester we looked at three languages (C++, Java and Python). One common rule in all three class checklists (for C++, Java and Python) ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers