Question: public static void main (String [] args) {String str1, str2; int Y; char X; str1 = Success is the result of hard work; x =
public static void main (String [] args) {String str1, str2; int Y; char X; str1 = "Success is the result of hard work"; x = str1, charAt (5); System, out. Print1n ("the value of x is; " + x); y = stri.indexOf ('h'); y = str1.indexOf ('w', y); str2 = str1. Substring (y); System. Out. Printin (x); System. Out. Printin (y); System. Out. Printin (str2);} public static void main (String [] args) {String str1, str2; int Y; char X; str1 = "Success is the result of hard work"; x = str1, charAt (5); System, out. Print1n ("the value of x is; " + x); y = stri.indexOf ('h'); y = str1.indexOf ('w', y); str2 = str1. Substring (y); System. Out. Printin (x); System. Out. Printin (y); System. Out. Printin (str2);}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
