Home /
Expert Answers /
Computer Science /
5-which-of-these-methods-of-class-string-is-used-to-compare-two-string-objects-for-their-equality-pa606
(Solved):
5. Which of these methods of class String is used to compare two String objects for their equality ...
5. Which of these methods of class String is used to compare two String objects for their equality? (1 mark) a) equals() b) Equals() c) ismatches() d) matches() 6. Which data type value is returned by equals () and matches () method of the String class? (1 mark) a) char b) literals c) boolean d) all of the mentioned 7. Where is an array stored in memory? ( 1 mark) a) heap space and stack space b) stack space c) heap space d) first generation memory 8. What is false about constructor? ( 1 mark \( ) \) a) Constructor can have a return type b) Java does not provide a default copy constructor c) Constructors cannot be synchronized in Java d) "this" and "super" can be used in a constructor 9. Abstract class can have a constructor. (1 mark) a) True b) False 10. What behaviour would be if the constructor has a return type? ( 1 mark) a) Compilation error b) Runtime error c) Compilation and runs successfully d) Only String return type is allowed