File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "query" Watch "query" New topic


sid dutta

Joined: Sep 07, 2008
Posts: 6
can we return arrays of any type through a function

if yes then please give an example
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46397
Yes. You can create an array of any type and return it, or pass it as a parameter.
Can't think of a return type offhand, but there is a very common parameter . .

public static void main(String[] args)

sid dutta

Joined: Sep 07, 2008
Posts: 6
i want to know that can there be a return type of any type of array
Arpit Sharma

Joined: Sep 10, 2008
Posts: 8
yes you can return Object [] for any type

example is as

public Object [] abc(){

return new String []{"1","2"};

SCJP 1.5
I agree. Here's the link:
subject: query
jQuery in Action, 3rd edition