Ask Question
5 March, 21:35

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?

+5
Answers (1)
  1. 5 March, 23:36
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers