当前位置:网站首页>Common methods of arrays
Common methods of arrays
2022-07-25 13:34:00 【Turn over the troubled times】
package com.javaming.study.easyexcel.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class arraysUtilsUse {
public static void main(String[] args) {
int[] int1 = {1, 2, 3};
int[] int2 = {1, 2, 3};
int[] int4 = {5, 2, 33, 435, 2342, 234, 435, 6756, 867, 345, 67, 567};
List<String> list = new ArrayList<>();
list.add("ww");
List<String> list2 = new ArrayList<>();
list2.add("ww");
// Element comparison
boolean b = Arrays.equals(int1, int2);
// Element comparison
boolean equals = Arrays.equals(list.toArray(), list2.toArray());
// Find element subscript
int i = Arrays.binarySearch(int4, 435);
// Element ordering
Arrays.sort(int4);
System.out.println(i);
// Array rotation String
System.out.println(Arrays.toString(int4));
String s = Arrays.toString(list.toArray());
System.out.println(Arrays.toString(int4));
System.out.println(s);
System.out.println(b);
System.out.println(equals);
}
}
6
[2, 5, 33, 67, 234, 345, 435, 435, 567, 867, 2342, 6756]
[2, 5, 33, 67, 234, 345, 435, 435, 567, 867, 2342, 6756]
[ww]
true
true
边栏推荐
- TCP的拥塞控制
- 【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)
- 0715RHCSA
- stable_ Baselines quick start
- 全网最简单解决方式1045-Access denied for user [email protected](using password:YES)
- Hcip day 6 notes
- What is your revenue rank among global developers in 2022?
- 0717RHCSA
- 0713RHCSA
- [ai4code final chapter] alphacode: competition level code generation with alphacode (deepmind)
猜你喜欢

Audio and video technology development weekly | 255

基于百问网IMX6ULL_PRO开发板移植LCD多点触摸驱动(GT911)

【GCN-RS】Towards Representation Alignment and Uniformity in Collaborative Filtering (KDD‘22)

Numpy简介和特点(一)

0710RHCSA

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略

Convolutional neural network model -- googlenet network structure and code implementation

从输入网址到网页显示

0713RHCSA

运动豪华还是安全豪华?亚洲龙与沃尔沃S60该入手哪款?
随机推荐
刷题-洛谷-P1047 校门外的树
Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
JS Array indexOf includes sort() 冒号排序 快速排序 去重和随机样本 random
运动豪华还是安全豪华?亚洲龙与沃尔沃S60该入手哪款?
从输入网址到网页显示
备战2022 CSP-J1 2022 CSP-S1 初赛 视频集
0720RHCSA
Numpy quick start
Introduction to jupyter notebook
In order to improve efficiency, there are various problems when using parallelstream
6.27 uniapp project history
嵌入式代码如何进行重构?
hcip第九天笔记
Peripheral system calls SAP's webapi interface
好友让我看这段代码
JS array indexof includes sort() colon sort quick sort de duplication and random sample random
录制和剪辑视频,如何解决占用空间过大的问题?
【服务器数据恢复】HP EVA服务器存储RAID信息断电丢失的数据恢复
Generate SQL script file by initializing the latest warehousing time of vehicle attributes
【CTR】《Towards Universal Sequence Representation Learning for Recommender Systems》 (KDD‘22)