SyntaxFix
Write A Post
Hire A Developer
Questions
You can return empty array by following two ways:
If you want to return array of int then
int
Using {}:
{}
int arr[] = {}; return arr;
Using new int[0]:
new int[0]
int arr[] = new int[0]; return arr;
Same way you can return array for other datatypes as well.