Write the result of each evaluated expression in the provide
Solution
a> s.length ---> compilation error: cannot find symbol length (length is property of array, length() is a method of string class)
b> (arr.length) ---> 5
c> (arr[2]); ----> 3
d> s.length(); ---> 11
e> s.charAt(3); ---> l
f> (drr.length); ---> 100
g> t.length(); ---> 0
h> s.toUpperCase(); ---> HELLO WORLD
i> s.indexOf(\"o\"); ---> 4
j> s.indexOf(\"o\",6) ---> 7 //give index of \"o\" starting from 6th position
k> s.substring(1,2) --> e //substring from start index to end index-1
l> s.substring(s.indexOf(\"wo\")) ---> world //index of \"wo\" is passed as a value to substring function
m> s.indexOf(s.substring(2,5)) ----> 2 // substring of s is passed as a value to the indexOf fucntion
n> s.substring(arr[4]) ---> orld // value 7 is passed into substring
o> arr[arr[2]] -----> 11 // is simplified as arr[3]
