Write a Java program to create a string in the form short_string + long_string + short_string from two strings. The strings must not have the same lengthTest Data: Str1 = PythonStr2 = Tutorial
Sample Output:
PythonTutorialPython
import java.lang.*; public class Exercise70 { public static void main(String[] args) { String str1 = "Python"; String str2 = "Tutorial"; if(str1.length() >= str2.length()) System.out.println( str2+str1+str2); else System.out.println(str1+str2+str1); } }
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