The concat() Method
This method concatenates the invoking String and the String specified and return the resulting string. The general form is:
String concat(String str);
ConcatTest.java
class ConcatTest
{
public static void main(String arg[])
{
String str="Hello";
String str2=str.concat("Java");
Systm.out.println(str2);
}
}
Will give the following Output:
Hello Java
Next Topic Shahbaz
0 comments:
Post a Comment