Ask Question

Consider the following code: / / Merge mailing list m2 into m1 void merge (MailingList m1, MailingList m2) { for (int i = 0; i < m2. numEntries (); + +i) m1. add (m2. getEntry (i)); } The programmers who first encountered this code fragment weren't sure if it was in C+ + or Java. In fact, with the addition of some appropriate declarations, it would probably compile correctly in either language. Which language is it? Explain your answer.

+1
Answers (1)
  1. 6 March, 20:03
    0
    That is a Java language

    Explanation:

    This is simply Because C+ + language does not support the calling of the methods without parameters and with the. (dot) operator.

    It can also be clearly noted that This is the functionality of Java, for example, to sort we call Array. Sort ().

    So the parameter here is passed by placing the variable at front with the. (dot).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider the following code: / / Merge mailing list m2 into m1 void merge (MailingList m1, MailingList m2) { for (int i = 0; i < m2. ...” 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