Write a Java program to create a new string of 4 copies of the last 3 characters of the original string. The length of the original string must be 3 and above
Sample Output:
3.03.03.03.0
import java.lang.*; public class Exercise68 { public static void main(String[] args) { String main_string = "Python 3.0"; String last_three_chars = main_string.substring(main_string.length() - 3); System.out.println(last_three_chars + last_three_chars + last_three_chars + last_three_chars); } }
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