Java The Complete Reference, Seventh Edition by Herbert Schildt
Author:Herbert Schildt [Schildt, Herbert]
Language: eng
Format: epub
Publisher: ePub Bud (www.epubbud.com)
Published: 2012-05-02T16:00:00+00:00
C h a p t e r 1 7 :
j a v a . u t i ll P a r t 1 : T h e C o ll ll e c t i o n s F r a m e w o r k
481
static int[ ] copyOf(int[ ] source, int len)
static long[ ] copyOf(long[ ] source, int len)
static short[ ] copyOf(short[ ] source, int len)
static <T> T[ ] copyOf(T[ ] source, int len)
static <T,U> T[ ] copyOf(U[ ] source, int len, Class<? extends T[ ]> resultT) The original array is specified by source, and the length of the copy is specified by len. If the copy is longer than source, then the copy is padded with zeros (for numeric arrays), nulls (for object arrays), or false (for boolean arrays). If the copy is shorter than source, then the copy is truncated. In the last form, the type of resultT becomes the type of the array returned. If len is negative, a NegativeArraySizeException is thrown. If source is null, a NullPointerException is thrown. If resultT is incompatible with the type of source, an ArrayStoreException is thrown.
The copyOfRange( ) method was also added by Java SE 6. It returns a copy of a range within an array and has the following forms:
static boolean[ ] copyOfRange(boolean[ ] source, int start, int end) static byte[ ] copyOfRange(byte[ ] source, int start, int end) static char[ ] copyOfRange(char[ ] source, int start, int end) static double[ ] copyOfRange(double[ ] source, int start, int end) static float[ ] copyOfRange(float[ ] source, int start, int end) static int[ ] copyOfRange(int[ ] source, int start, int end) static long[ ] copyOfRange(long[ ] source, int start, int end) static short[ ] copyOfRange(short[ ] source, int start, int end) static <T> T[ ] copyOfRange(T[ ] source, int start, int end) static <T,U> T[ ] copyOfRange(U[ ] source, int start, int end, Class<? extends T[ ]> resultT)
The original array is specified by source. The range to copy is specified by the indices passed via start and end. The range runs from start to end –1. If the range is longer than source, then the copy is padded with zeros (for numeric arrays), nulls (for object arrays), or false (for boolean arrays). In the last form, the type of resultT becomes the type of the array returned. If start is negative or greater than the length of source, an ArrayIndexOutOfBoundsException is thrown. If start is greater than end, an IllegalArgumentException is thrown. If source is null, a NullPointerException is thrown. If resultT is incompatible with the type of source, an ArrayStoreException is thrown.
The equals( ) method returns true if two arrays are equivalent. Otherwise, it returns false.
The equals( ) method has the following forms:
static boolean equals(boolean array1[ ], boolean array2[ ])
static boolean equals(byte array1[ ], byte array2[ ])
static boolean equals(char array1[ ], char array2[ ])
static boolean equals(double array1[ ], double array2[ ])
static boolean equals(float array1[ ], float array2[ ])
static boolean equals(int array1[ ], int array2[ ])
static boolean equals(long array1[
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ada | Ajax |
Assembly Language Programming | Borland Delphi |
C & C++ | C# |
CSS | Compiler Design |
Compilers | DHTML |
Debugging | Delphi |
Fortran | Java |
Lisp | Perl |
Prolog | Python |
RPG | Ruby |
Swift | Visual Basic |
XHTML | XML |
XSL |
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8298)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Windows APT Warfare by Sheng-Hao Ma(6845)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6575)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6445)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6414)
Kotlin in Action by Dmitry Jemerov(5063)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4317)
Functional Programming in JavaScript by Mantyla Dan(4038)
Solidity Programming Essentials by Ritesh Modi(4005)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3797)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3741)
The Ultimate iOS Interview Playbook by Avi Tsadok(3714)
