array string java in one line

Java
String[] stringarray = {"string1", "string2", "string3"};
Source

Also in Java: