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

1 Expert Approved Answer
Step: 1 Unlock

In the provided Java code a substring of the greeting string is created using the substring method T... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!