I am getting little bit confused with returning arrays and objects created locally in the function call. So I believe - 

C - No Objects, only arrays and structures can be created on stack, so will be deleted when function returns. So its not wise to send them as return value to the calling module.
C++ - Objects & structures resides in heap, so objects can be returned but nothing else, i.e. arrays will still be destroyed when returning
Java - I can return arrays as well as Objects, I guess arrays moved to heap here?
Python - Same as Java, Objects and Arrays created locally can be returned to calling module as reference.

Please correct me if I am wrong somewhere. Now why would java/python put arrays in heap? being interpreted languages is that the reason? So would every compiled language will not let me return locally created arrays back to calling module.
Thanks in advance.
to extend a little the answer: 
Python manage lifetime by reference counting. When an object has no references it'll be destructed or finalized and released. 
In Java I think that happens exactly the same
returning arrays and objects created in functions in various languages