Question: What is the output? public static void main(String args[]) { String greeting = Java World!; String w = greeting.substring(7, 11); System.out.println(w); }
What is the output?
public static void main(String args[]) {
String greeting = "Java World!";
String w = greeting.substring(7, 11);
System.out.println(w);
}
Step by Step Solution
There are 3 Steps involved in it
In the provided Java code a substring of the greeting string is created using the substring method T... View full answer
Get step-by-step solutions from verified subject matter experts
