1/40
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
charAt()
returns the character at a specified index
What would the code return?
String myStr = "Hello";
char result = myStr.charAt(0);
System.out.println(result);H
codePointAt()
returns the Unicode of a character at a specified index

What would the code return?
String myStr = "Hello";
int result = myStr.codePointAt(0);
System.out.println(result);72
codePointBefore()
returns the Unicode of a character before the specified index

What would the code return?
String myStr = "Hello";
int result = myStr.codePointBefore(1);
System.out.println(result);72
codePointCount()
returns the number of Unicode values found in a string
What would the code return?
String myStr = "Hello";
int result = myStr.codePointCount(0, 5);
System.out.println(result);5
compareTo()
compares two strings lexicographically.
What would the code return?
String myStr1 = "Hello";
String myStr2 = "Hello";
System.out.println(myStr1.compareTo(myStr2));0
compareToIgnoreCase()
compares two strings lexicographically, ignoring case differences
What would the code return?
String myStr1 = "HELLO";
String myStr2 = "hello";
System.out.println(myStr1.compareToIgnoreCase(myStr2));0
concat()
contains()
checks whether a string contains a character sequence
What would the code return?
String myStr = "Hello";
System.out.println(myStr.contains("Hel")); // true
System.out.println(myStr.contains("e")); // true
System.out.println(myStr.contains("Hi")); // falsetrue
true
false
format()
What would the code return?
getChars()
What would the code return?
indexOf()
What would the code return?
isEmpty()
What would the code return?
join()
What would the code return?
length()
What would the code return?
split()
What would the code return?
substring()
What would the code return?
subSequence()
What would the code return?
toLowerCase()
What would the code return?
toUpperCase()
What would the code return?
toString()
What would the code return?
trim()
What would the code return?