Write a Java program to extract the first half of a string of even lengthTest Data: PythonSample Output:
Pyt
import java.lang.*; public class Exercise69 { public static void main(String[] args) { String main_string = "Python"; System.out.println(main_string.substring(0, main_string.length()/2)); } }
Sample Output:
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer