Question: Question #312 pts). To compare strings in Java you can't simply use the relational operators. You need to use methods of the String class: equals0,

Question #312 pts). To compare strings in Java you can't simply use the relational operators. You need to use methods of the String class: equals0, compareTo0, and substring). Assume the following code String word1 "catalog". String word2 "cat", Write the following 3 conditions in Java For Example: word1 is lexicographically greater than "aaa" Answer: word1.compareTo("aaa") >0 a) word1 is lexicographically not equal to word2 b) word1 is lexicographically greater than word2 c) word1 and word2 have the same two-letter prefix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
