How should I declare main() method in Java?
main()
Like this:
public static void main(String[] args) { System.out.println(\"foo\"); } >
public static void main(String[] args) { System.out.println(\"foo\"); }
String[] is an array of Strings. Therefore a container of many variables of String data type. For example:
String[]
String
String[] strArray = new String[2]; str[0] = "Hello"; str[1] = "World"; String str = "Hello World";
Hope this clears your queries :)