12
Dec
Method name: String.concat();
public class Main { public static void main(String[] args) { String sentence1="Hello "; System.out.println(sentence1.concat("Java")); } }
Output:
Hello Java
… Read more Method name: String.concat();
public class Main { public static void main(String[] args) { String sentence1="Hello "; System.out.println(sentence1.concat("Java")); } }
Output:
Hello Java
… Read more Java String is a very important topic in Java. It’s basically an object, that represent sequence of char values. Also, you can create String objects by using the new keyword and a constructor.
char[] ch={‘r’,’o’,’a’,’d’,’t’,’o’,’s’,’d’,’e’,’t’};
String string=new String(ch);
is same … Read more