package Arrays class ;

 import java.util.Arrays;

 public class TestArrays {
public static void main(String[] args) {
int[] a={1,9,3,5,7,8,2,6,0,4};
System.out.println(Arrays.binarySearch(a, 9));//-11
Arrays.sort(a);
System.out.println(Arrays.binarySearch(a, 9));//
int[] b=new int[9];
Arrays.fill(b, 8);
System.out.println(Arrays.toString(b));//[8, 8, 8, 8, 8, 8, 8, 8, 8]
}
}

【java】java.util.Arrays Class commonly used methods of more related articles

  1. Java Array operations in java.util.Arrays Class commonly used methods

    Any programming language , Arrays are one of the most important and commonly used data structures , But different languages have different ways to construct and process arrays . Java Provided in java.util.Arrays Class can operate arrays conveniently , And all the methods it provides are static ...

  2. java Basics -Arrays Class common methods

    java Basics -Arrays Class common methods author : Yin Zhengjie Copyright notice : Original works , Declined reprint ! Otherwise, the legal liability will be investigated . One .Array The concept of class This class contains the operation array ( Such as sorting and searching ) Various methods of . We need to pay attention to , If specified ...

  3. java.util.Arrays class

    Preface :java.util.Arrays Class, please see Oracle Official website 1.Arrays Class : Resources for this article : Baidu library :Oracle Official website : Third party Chinese technical documents

  4. JDK1.8 Source code ( Four )——java.util.Arrays class

    java.util.Arrays Class is JDK A tool class provided , Various ways to deal with arrays , And every method is basically static , Can be directly through the class name Arrays call . 1.asList public static ...

  5. java.util.Arrays Class explanation ( Source code summary )

    summary Arrays Class is located java.util It's a bag , Is a tool class for array operations . Today, I have a detailed look at Arrays Class 4 More than 1000 lines of source code , Will now Arrays Class to make a summary (JDK edition :1.6.0_34).Array ...

  6. [19/03/12- Tuesday ] Array _ Traverse (for-each)& Copy &java.util.Arrays class

    One . Traverse for-each That is to enhance for loop , yes JDK1.5 New features , Dedicated to reading all elements in an array or collection , That is to traverse the array . // Array traversal for-each public class Test_03 ...

  7. Java Commonly used API(Arrays class )

    Java Commonly used API(Arrays class ) What is? Arrays class ? java.util.Arrays This class contains various methods for manipulating arrays , Such as sorting and searching . All of them are static methods , Call it up It's simple . Here we are ...

  8. HttpTool.java( stay java tool util Tool class already exists ) For the time being

    HttpTool.java The class for java It's from ecology http Request tool , Don't rely on third parties jar package , Plug and play . package kingtool; import java.io.BufferedReader ...

  9. java in java.util.Arrays class --- Common function records

    java.util.Arrays Mainly used to operate on the array class , It mainly includes the following methods : 1. Array conversion list , Get a fixed size list ,Arrays.asList(...): public static <T& ...

Random recommendation

  1. Mac edition PhpStorm And XAMPP Integrate apache Server configuration

    Copyright notice : This article is an original blog article , No reprint without the permission of the blogger . Choice in PhpStorm Integrate apache The server , Here are the steps of my own personal test . 1. How to modify apache Default port xampp apache default http ...

  2. spring boot add to jsp Support considerations

    1. Be sure to use war package <packaging>war</packaging>2. take provided Change it to compile, As follows : <dependency> <g ...

  3. hadoop-2.6.0-src Source code import Eclipse Reprint

    Reprinted address :http://m.blog.csdn.net/blog/le119126/42009281 One . Import Modify the source code first Reference resources   Two . Correct the second one in the mistake 3 strip 1.cd To hadoop-2.6.0-src/h ...

  4. MFC Introduction to programming 17 ( Dialog box : File dialog )

    The last lecture introduced the message dialog box , This section explains the file dialog . File dialog is also a very common kind of dialog . Classification of file dialog boxes File dialog box is divided into open file dialog box and save file dialog box , I believe you are Windows These two file dialog boxes are often seen in the system ...

  5. 004_kafka_ Installation and operation

    1. Download and install at present kafka The stable version of is 0.10.0.0 Download address :http://kafka.apache.org/downloads.html After downloading, unzip the installation package to the system to complete the installation > ta ...

  6. 20150226--WebForm in GridView

    WebForm Medium GridView The usage of is basically the same as winForm Medium DataGridView Agreement , Its data binding method uses LinqDateSource take GridView Drag into the web page , The following format appears : Automatic cover ...

  7. Linux Study sed command

    sed It's an online editor , It processes one line at a time . When dealing with , Store the currently processed rows in a temporary buffer , be called “ Mode space ”(pattern space), Then use sed Command processing buffer contents , After processing , Send the contents of the buffer to ...

  8. Batch command line CMD Start stop restart IIS The order of

    original text : Batch command line CMD Start stop restart IIS The order of start-up IIS: net start iisadmin    (IIS Our entire service ) net start w3svc       (WWW Webpage WEB service ) ...

  9. drive 09.nand flash

    1 nand flash The operation of Purpose : Read the address A The data of , The data B Write the address A. ask 1. On the schematic diagram NAND FLASH and S3C2440 There's only a data line between them , How to transfer the address ? answer 1. stay DATA0-DATA7 Data is transmitted on the Internet ...

  10. UVALive 7045 Last Defence

    ProblemK. Last Defence Description Given two integersA and B. Sequence S is defined as follow: • S0 ...