0% found this document useful (0 votes)
38 views1 page

Java String Concatenation Example

This Java program defines a main method that declares an integer variable x with a value of 10, a String variable y with a value of "janapath", and concatenates x and y into String variable z. It then prints the value of z to output 10janapath, demonstrating string concatenation in Java.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

Java String Concatenation Example

This Java program defines a main method that declares an integer variable x with a value of 10, a String variable y with a value of "janapath", and concatenates x and y into String variable z. It then prints the value of z to output 10janapath, demonstrating string concatenation in Java.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

javatest95

package maheswarijavapackage;
public class javatest95
{
public static void main(String[] args)
{
int x=10;
String y="janapath";
String z=x+y;
[Link](z); //concatenation

}
javatest95 output

10janapath

You might also like