Loading...
What is the data type returned by the following library methods?
The output of the statement "CONCENTRATION".indexOf('T') is:
The output of the statement "talent".compareTo("genius") is:
The following code to compare two strings is compiled, the following syntax error was displayed – incompatible types – int cannot be converted to boolean. Identify the statement which has the error and write the correct statement. Give the output of the program segment. void calculate() { String a = "KING", b = "KINGDOM"; boolean x = a.compareTo(b); System.out.println(x); }
Define a class to accept the gmail id and check for its validity. A gmail id is valid only if it has: → @ → . (dot) → gmail → com Example: icse2024@gmail.com is a valid gmail id.
What is the output of the statement given below? “ANGER”.compareTo(“ANGEL”)
© 2026 PadhAiPro. This question is provided for educational purposes.