This code prints out a specified portion of a given string. It takes the original string "Tutor Joe's Computer Education" and then uses the substring method to extract a substring starting from position 11 and ending at position 20 (exclusive), which corresponds to the substring "Computer". Here's a breakdown of the code:
public class Specified_Position { public static void main(String[] args) { String str = "Tutor Joe's Computer Education"; String new_str = str.substring(11, 20); System.out.println("Given String : " + str); System.out.println("SubString of a given String : " +new_str); } }
Given String : Tutor Joe's Computer Education SubString of a given String : Computer
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions