English

The out put of the statement "CONCENTRATION" indexOf('T') is ______. - Computer Applications

Advertisements
Advertisements

Question

The output of the statement "CONCENTRATION" indexOf('T') is ______.

Options

  • 9

  • 7

  • 6

  • (-1)

MCQ
Fill in the Blanks
Advertisements

Solution

The output of the statement "CONCENTRATION" indexOf('T') is 6.

Explanation:

The index position of 'T' in "CONCENTRATION" is 6.

shaalaa.com
  Is there an error in this question or solution?
2023-2024 (March) Official

RELATED QUESTIONS

Write the return data type of the following function:

endsWith( )


Write a program to initialize the seven Wonders of the World along with their locations in two different arrays. Search for the name of the country input by the user. If found, display the name of the country along with its Wonder, otherwise display “Sorry Not Found!”. 
Seven wonders — CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL, GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations — MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example

Country Name: INDIA     Output: INDIA-TAJMAHAL
Country Name: USA        Output: Sorry Not Found!


Give the output of the following string methods.

"MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')


Define a class to accept a string, convert it into lowercase and check whether the string is a palindrome or not.

A palindrome is a word that reads the same backward as forward.

Example:

madam, racecar etc.


The String class method to join two strings is ______.


Give the output of the following String class method:

"COMMENCEMENT".lastIndexOf('M')

Give the output of the following String class method:

"devote". compareTo("DEVOTE")

Define a class to accept a String and print the number of digits, alphabets and special characters in the string.

Example: S = "KAPILDEV@83"
Output: Number of digits - 2 '
Number of Alphabets - 8
Number of Special characters - 1

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);
  }

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×