package ArraysTest;
import java.util.Arrays;
public class ArraysTest {
/**
* @param args
*/
public static void main(String[] args) {
int temp[] = {3,4,5,7,9,1,2,6,8} ; // 声明一个整型数组
Arrays.sort(temp) ; // 进行排序的操作
System.out.print("排序后的数组:") ;
System.out.println(Arrays.toString(temp)) ; // 以字符串输出数组
// 如果要想使用二分法查询的话,则必须是排序之后的数组
int point = Arrays.binarySearch(temp,3) ; // 检索位置
System.out.println("元素‘3’的位置在:" + point) ;
Arrays.fill(temp,3) ;// 填充数组
System.out.print("数组填充:") ;
System.out.println(Arrays.toString(temp)) ;
}
}
分享到:
相关推荐
Gain an in-depth understanding of PHP 7 arrays. After a quick overview of PHP 7, each chapter concentrates on single, multi-dimensional, associative, and object arrays. PHP Arrays is a first of its ...
radar antenna arrays, and smart antenna arrays for automatic cruise control applications provide increased safe travelling for vehicle passengers. Vehicle localization techniques based on the antenna ...
Antenna Arrays.pdf
PHP Arrays Single Multi-dimensional Associative and Object Arrays in PHP 7 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn...
PHP Arrays Single, Multi-dimensional, Associative and Object Arrays in PHP 7 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如...
《Digital Signal Processing with Field Programmable Gate Arrays》扫描版
/** *Arrays提供数组操作的一系列实用方法 *1输出 *2排序 *3二分查找 *4复制 *5扩容 */
Protein.Arrays,.Biochips,.and.Proteomics.-.Joanna.S.Albala
The contents itself is organized in three chapters according to the network architecture: arrays and trees for Chapter 1 (117 pages), meshes of trees for Chapter 2 (117 pages), and hypercubes and ...
ite_Antenna_Arrays_and_FSS
个人研究所得,包含对其内部jdk源码的分析。 同时会结合ArrayList中对该两个方法的调用做进一步说明。...总结一句话:在允许的情况下,尽量调用System.arraycopy方法,实在不行再调用Arrays.copyOf方法。
网络图片地址url集合arrays.xml文件
Microphone Arrays : A Tutorial
Constructing Compressed Suffix Arrays with Large Alphabets 生物信息论文
Various technical issues are addressed in the frequency-and time-domain finite element analysis of complex antennas and arrays that may consist of fine structures and composite materials. analysis is ...
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Java AC版本
天线圣经-Finite Antenna Arrays and FSS
Light scattering by particle and hole arrays for electric magnetic
利用电磁波的相干原理,通过计算机控制输往天线各阵元电流相位的变化来改变波束的方向,同样可进行扫描,称为电扫描。天线阵,根据扫描情况可分为相扫、频扫、相/相扫、相/频扫、机/相扫、机/频扫、有限扫等多种体制...
Digital Signal Processing with Field Programmable Gate Arrays 3rd