My issue
Write a program which does the following:
Create a string variable word and assign the text "Programming" to it.
Print the characters o and r from the string word in separate lines using the syntax defined above.
My code
class Codechef
{
public static void main (String[] args)
{
String word = "Programming";
System.out.print(word.charAt(2));
System.out.print(word.charAt(1));
}
}
Learning course: Advanced Java programming
Problem Link: Outputting Characters from a String in Advanced Java programming