Difference between String[] (with square brackets) and String (without square brackets) in Java -
this question has answer here:
- how declare , initialize array in java? 17 answers
just starting learn java, found "string" in function has 2 square brackets beside:
public static void main (string[] parameter){ system.out.println("hello world"); }
but 1 has not:
public void setname(string name){ this.name = name; }
what diference?
[]
signifies array, or list of many strings, whilst string
1 string.
Comments
Post a Comment