Thank you for reply, how will Integer.MAX_VALUE help find length of random array here, u are passing array as parameter to function but what is Integer.MAX_VALUE doing in this code. thanks

Have you read the API documentation for the Integer class? You should have and preferably you should've bookmarked that Sun site for handy reference; you need it (I need it too, everybody who wants to program in Java needs that documentation). Here's the link.