Difference between String[] (with square brackets) and String (without square brackets) in Java -


this question has answer here:

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

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -