Consider the line of code String string1 new StringCoursera
Consider the line of code: String string1 = new String(\"Coursera\"); What linc(s) of code can you use to assign the char \'s\' to the variable letter? Answer:
Solution
char letter;
for(int i=0;i<string1.length();i++)
{
if(string1.charAt(i)==\'s\')
{
letter=string1.charAt(i);
}
}
