Hi,
I created a sample application in java which concatenates three strings and displays the result in a final string.
Check the code:-
public class conCat
{
public static void main (String[] args)
{
String Message1 = "This ";
String Message2 = "is a Sample ";
String Message3 = "Application";
String Message = Message1 + Message2 + Message3;
System.out.println(Message);
}
}
output:
C:\>javac C:\javaprog\conCat.java
C:\>java conCat
This is a Sample Application
And the three strings are concatenated to the final string "Message" only.
How to concatenate them vertically?
The required output is :
This
is a sample
Application
Kindly provide me the solution.