This documentation is archived and is not being maintained.

Arrays.sort Method (Object[ ])

Visual Studio 2005

Sorts the specified Object array in an ascending order.

Package: java.util

Assembly: vjslib (in vjslib.dll)


public static void sort(
    java.lang.Object[] arr);

Parameters

arr

The array to be sorted.

// Arr-ObSrt.jsl 
// Arrays.sort example 
import java.util.*; 
public class MyClass 
{ 
public static void main() 
{ 
// Declare an array: 
Object[] myArr = {"A","1.0","Zoo","Z"}; 
// Sort data: 
Arrays.sort(myArr); 
// Display the array: 
for(int i=0; i<myArr.length; i++) 
System.out.print(myArr[i] + " "); 
} 
} 
/* 
Output: 
1.0 A Z Zoo 
*/ 
Show: