Check out example codes for "string java". It will help you in understanding the concepts better.

Code Example 1

char data[] = {'a', 'b', 'c'};
     String str = new String(data);

Code Example 2

//string syntax.
String hello = "Hello, world!";

Code Example 3

System.out.println("abc");
     String cde = "cde";
     System.out.println("abc" + cde);
     String c = "abc".substring(2,3);
     String d = cde.substring(1, 2);

Code Example 4

//Object... (here String...) means that you can give
//in parameter one or many objects of same type

func();

func("arg1", "arg2", "arg3");

String[] args = new String[]{"arg1", "arg2", "arg3"}
func(args);

void func(String... args);

Code Example 5

public String trim()

String x = " hi ";
System.out.println( x + "x" ); // result is" hi x"
System.out.println(x.trim() + "x"); // result is "hix"

Code Example 6

String str = "abc";

Learn ReactJs, React Native from akashmittal.com