
Java: Math & String
Quiz by Michael Engel
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
What will be the output of this code:
String str = "Hello, World!";int index = str.indexOf("o");
System.out.println(index);
What will be the output of this code?
String str = "Hello, World!";
String substring = str.substring(7);
System.out.println(substring);
What will be the output of this code:
String str = "OpenAI";
char ch = str.charAt(2);
System.out.println(ch);
What will be the output of this code:
String str = "Hello, World!";
String upperCase = str.toUpperCase();
System.out.println(upperCase);
What will be the output of this code:
String str = "Hello, World!";
System.out.println(str.length());
What will be the output of this code:
String str = "Java Programming";
System.out.println(str.substring(5, 12));