I have searched a lot on the website, but didn't find any related question. So I believe it is not a duplicate.
I know we can initialize an array with 3 ways:
char[ ] charAr=new char[10];
char[ ] charAr={'a', 'b', 'c'};
char[ ] charAr=new char[]{'a','b','c'};
1st question is: what is the name of {'a','b','c'}
kind of stuff? Is it called array literals?
2nd question is: what is the difference between new char[]{'a','b','c'}
with {'a','b','c'}
?
3rd question is: why I can't return a newly created array with {'a','b','c'}
?
I have to return new char[]{'a','b','c'}
.
4th question: both new char[10]
and new char[]{'a','b','c'}
are constructors of array, right?