当前位置:网站首页>Arrays class
Arrays class
2022-06-30 04:37:00 【Beginner 891】
● Arrays Class is used to manipulate the array utility class , It defines the static methods for common array operations .
equals Method
● Compare whether two different arrays are equal , And the array itself equals Judge another number Whether the group itself .
● Statement :public static boolean equals(type[]a,type[]a2)
● The type of a parameter can be either a native data type or a reference type .
● return : If two are equal , Then return to true, Otherwise return to false
sort - Sort
● Acts on all elements of the array public static void sort(type[] a)
● Acts on elements in the specified range of the array public static void sort(type[] a, int fromIndex( Include ), int toIndex( barring )) The specified type ( except boolean Any native data type other than ) Array all elements ( Or specified range Elements in the enclosure ) Sort in ascending numerical order . object Type of the array , According to the natural order of the elements , Sorts the array of specified objects in ascending order . (fromIndex==toIndex, The sorting range is empty )
● Custom object sorting Custom class implementation Comparable Interface rewrite compareTo Method
binarySearch - Use the binary search algorithm to search the specified array
● Statement : public static int binarySearch(type[] a, type key)
public static int binarySearch(long[] a,int fromIndex,int toIndex,long key)
● describe : Use the binary search algorithm to search the specified type Type of the array , To get the specified value .
● Parameters : a - Array to search .
key - Value to search .
fromIndex - Index of the first element to sort ( Include ).
toIndex - Index of the last element to sort ( barring ).
type -byte、double、float、object、long、int、short、char
● If key In the array , Then return the index of the search value ; Otherwise return to -1 perhaps ”-“ ( The insertion point )
toString() Method
● Statement :public static String toString(type[] a)
● describe : Returns a string representation of the contents of a specified array .
● Basic array , The string representation consists of a list of elements of an array , Included in [], Adjacent elements use “ , ”( Comma with space ) Separate .
边栏推荐
- 【Paper】2021_ Observer-Based Controllers for Incrementally Quadratic Nonlinear Systems With Disturbanc
- Detailed explanation of data link layer
- Use of thread pool
- JS file block to Base64 text
- Break through the existing customer group marketing, and try customer grouping management (including clustering model and other practical effect evaluation)
- SSL update method
- 破局存量客群营销,试一下客户分群管理(含聚类模型等实操效果评估)
- Code cloud fatal: authentication failed for
- JS generator
- Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions
猜你喜欢

JS inheritance

Threejs实现模拟河流,水面水流,水管水流,海面

Beanfactory creation process

MySQL DDL change

Redis实现短信登入功能(二)Redis实现登入功能

【Paper】2017_ Distributed control for high-speed trains movements

Junior students summarize JS basic interview questions

Myrpc version 4

Wildcard SSL certificate issuing time

How the FortiGate firewall rejects a port by using the local in policy policy
随机推荐
【Paper】2021_ Observer-Based Controllers for Incrementally Quadratic Nonlinear Systems With Disturbanc
Servlet lifecycle
QT 6.3.1conan software package release
[fpga] implementation of IIC read / write EEPROM
How to repair expired SSL certificates?
Method of applying for code signing certificate by enterprise
Qos(Quality of Service)
Use of thread pool
Threejs实现模拟河流,水面水流,水管水流,海面
Mongodb learning
SQL error caused by entity class: Oracle "ora-00904" error: possible case of invalid identifier
Redis实现短信登入功能(二)Redis实现登入功能
Es2019 key summary
Network layer protocol hardware
SSL update method
How to use div boxes to simulate line triangles
【WEBRTC】ADM: rtc_ include_ internal_ audio_ Device triggers RTC_ Dcheck (ADM) assertion
FortiGate creates multiple corresponding DDNS dynamic domain names for multiple ADSL interfaces
Junior students summarize JS advanced interview questions
Memorize unfamiliar words at SSM stage and update them from time to time