Podcast
Questions and Answers
Which method is used to find the length of a string?
Which method is used to find the length of a string?
- length() (correct)
- charAt()
- concat()
- compareTo()
Which method is used to compare two strings and returns a positive value if the first string is alphabetically greater than the second string?
Which method is used to compare two strings and returns a positive value if the first string is alphabetically greater than the second string?
- compareTo() (correct)
- concat()
- length()
- charAt()
Which method is used to concatenate two strings?
Which method is used to concatenate two strings?
- charAt()
- compareTo()
- concat() (correct)
- length()
Which method is used to find the character present at a particular index in a string?
Which method is used to find the character present at a particular index in a string?
Which method is used to convert a string to upper case?
Which method is used to convert a string to upper case?
Which method is used to get a substring of a string?
Which method is used to get a substring of a string?
Which method is used to create a formatted string in Java?
Which method is used to create a formatted string in Java?
Which class in Java is used to create and manipulate strings?
Which class in Java is used to create and manipulate strings?
Which of the following is true about strings in Java?
Which of the following is true about strings in Java?
What is the most common way of creating a Java string?
What is the most common way of creating a Java string?
What happens when we try to create another string with the exact same value as an existing string using String literals?
What happens when we try to create another string with the exact same value as an existing string using String literals?
Where are strings stored in Java?
Where are strings stored in Java?
Which of the following is true about the immutability of strings in Java?
Which of the following is true about the immutability of strings in Java?
How are strings represented internally in Java?
How are strings represented internally in Java?
Which method is used to get the substring from the beginIndex till the end of the string?
Which method is used to get the substring from the beginIndex till the end of the string?
Which method is used to get the substring from beginIndex till endIndex-1?
Which method is used to get the substring from beginIndex till endIndex-1?
Which method is used to check if the string contains a particular substring or not?
Which method is used to check if the string contains a particular substring or not?
Which method is used for replacing all occurrences of string1 in the string with string2?
Which method is used for replacing all occurrences of string1 in the string with string2?
Which method is used to replace only the first occurrence of string1 with string2?
Which method is used to replace only the first occurrence of string1 with string2?
Which method is exactly like replace() and replaces all occurrences of string1 with string2?
Which method is exactly like replace() and replaces all occurrences of string1 with string2?
Which method is used for finding the index of a character or a string from a given string?
Which method is used for finding the index of a character or a string from a given string?
Which method is used to check whether a string is empty or not?
Which method is used to check whether a string is empty or not?
What does the lastIndexOf() method do?
What does the lastIndexOf() method do?
What does the hashCode() method return?
What does the hashCode() method return?
What does the split() method do?
What does the split() method do?
Which split() method limits the number of strings to be split based on the delimiter?
Which split() method limits the number of strings to be split based on the delimiter?
What does the toCharArray() method do?
What does the toCharArray() method do?
What does the toString() method do?
What does the toString() method do?
What does the join() method do?
What does the join() method do?
Which method returns the index of the first occurrence of a character or string?
Which method returns the index of the first occurrence of a character or string?