File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

query

sid dutta
Greenhorn

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
Sheriff

Joined: Oct 13, 2005
Posts: 36497
    
  16
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
Greenhorn

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

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: http://aspose.com/file-tools
 
subject: query