answersLogoWhite

0


Best Answer

You don't specify "these methods", but chances are what you're looking for is the charAt method

User Avatar

Wiki User

7y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

7y ago

In Java, the charAt() method does that. You can find information on these and other methods in the online documentation of the Java String class.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which of these methods of string class is used to obtain character at specified index?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What does it mean to have a string split in java?

To have a string split in Java means that a string array, containing substrings (can be delimited by elements of a specified string or Unicode character array), is returned.


What is directory creation and deletion?

CreateDirectory(String) Creates all directories and subdirectories in the specified path. CreateDirectory(String, DirectorySecurity) Creates all the directories in the specified path, applying the specified Windows security. Delete(String) Deletes an empty directory from a specified path. Delete(String, Boolean) Deletes the specified directory and, if indicated, any subdirectories and files in the directory. public static DirectoryInfo CreateDirectory ( string path ) public static void Delete ( string path, bool recursive )


How do you convert a string into a character array?

A string is, by definition, a character array. No conversion is required.


A character array terminated with the null character is most correctly called what?

zero-terminated string


Replace a character by another character in a given string?

C SolutionTo replace a single, specified character with another in a given string, one possibility is ...char *pszString; /* pointer to string */int offset; /* offset of desired character */... initialize pszString and offset*(pszString+offset) = 'A'; /* or whatever new value you want */Obviously, this is a simple example, and it does not consider if offset is greater than the size of the array.If you want to replace every occurence of a character with another, here is another possibility, one that also handles string length ...char *pszString; /* pointer to string */char* pszTemp; /* temporary scanning pointer */char cOldChar; /* character to change */char cNewChar; /* new character */... initialize pszString, cOldChar, and cNewCharfor (pszTemp = pszString; *pszTemp != '\0'; pszTemp++) { /* scan */if (*pszTemp == cOldChar) *pszTemp = cNewChar; /* conditionally replace */}Java Solution// Replace all 'e' characters with 'i' characters in String strstr.replaceAll("e", "i");

Related questions

What function returns the number of occurrences of a specified character in the input string?

The charAt function returns the number of occurrences of a specified character in the input string.


What does it mean to have a string split in java?

To have a string split in Java means that a string array, containing substrings (can be delimited by elements of a specified string or Unicode character array), is returned.


Difference between character and string?

A string ends with a '\0' character,but character is not.


What is directory creation and deletion?

CreateDirectory(String) Creates all directories and subdirectories in the specified path. CreateDirectory(String, DirectorySecurity) Creates all the directories in the specified path, applying the specified Windows security. Delete(String) Deletes an empty directory from a specified path. Delete(String, Boolean) Deletes the specified directory and, if indicated, any subdirectories and files in the directory. public static DirectoryInfo CreateDirectory ( string path ) public static void Delete ( string path, bool recursive )


Which character in string is used to end the string?

Character zero (the byte with the decimal value zero) is sometimes used to end a string. But in other cases, the size of the string is stored at the beginning of the string, and there is no end-of-string character. This allows any character to be included in the string.


How do you convert a character into a string?

A string is, by definition, a character array. No conversion is required.


How do you convert a string into a character array?

A string is, by definition, a character array. No conversion is required.


Is string is an object?

No. A string is, by definition, a character array.


Is string an object?

No. A string is, by definition, a character array.


What is the difference between A and A in string?

Well, A is an identifier; 'A' is a character-literal; "A" is a string literal (of 1 character); "'A'" is another string literal (of 3 characters).


A character array terminated with the null character is most correctly called what?

zero-terminated string


Java program convert the inputed words into its upper case or lower case form?

There are methods in the String class; toUppercase() and toLowerCase(). i.e. String input = "Hello!"; String upper = input.toUpperCase(); //stores "HELLO!" String lower = input.toLowerCase(); //stores "hello!" -Note: these methods are NOT modifier methods therefore the original string is still "Hello!"