Home / Questions / Can a function return an array in Java?
Explanatory Question

Can a function return an array in Java?

👁 1 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Yes, a function can return an array in Java by specifying the array type as the return type.


int[] getArray()