Home >Java >JavaBase >Commonly used classes in java——Arrays

Commonly used classes in java——Arrays

王林
王林forward
2019-11-28 15:15:002046browse

Commonly used classes in java——Arrays

Overview

java.util.Arrays This class contains various methods for manipulating arrays, such as sorting and search etc. All its methods are static methods and are very simple to call.

Methods for operating arrays

public static String toString(int[] a) : Returns the string representation of the specified array content.

Free online video teaching: java video tutorial

Example:

Commonly used classes in java——Arrays

public static void sort (int[] a) : Sort the specified int array in ascending numerical order.

Example:

Commonly used classes in java——Arrays

Exercise

Please use the relevant API to convert a All characters in a random string are arranged in ascending order and printed in reverse order.

Example:

Commonly used classes in java——Arrays

More related articles and tutorials are recommended:java entry program

The above is the detailed content of Commonly used classes in java——Arrays. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete