Declaring and initializing a string array Atom Feed 0

In Brief Just a quick reference for how to declare a string array using a set list of strings, also how to declare a string array in a function call with Java.
# 's
 1public class TestClass {
2 public static String[] sArray = {"this","are","my","elements"};
3
4 public static void foo(String[] array){
5 //thanks for the array!
6 }
7
8 public static void main(String[] args){
9 TestClass bar = new TestClass();
10 bar.foo(new String[]{"another","array","declared","in","fxn","call"});
11 bar.foo(sArray);
12 }
13}

Just a quick reference for how to declare a string array using a set list of strings, also how to declare a string array in a function call with Java.