[Java SE 11 Silver] Arrays class method summary [Java beginner]

Introduction

I have been learning Java for about 3 months. Joined SES from inexperienced, while receiving Java training I am studying Java SE 11 Silver on Saturdays and Sundays.

Since the content of the company training was up to Java 7, there were many contents for the first time, This time, I will summarize three methods of the Arrays class of Kuromoto Chapter 9 API.

table of contents

[1.asList method](# 1asList method) [2.compare method](# 2compare method) [3.mismatch method](# 3mismatch method)

1. asList method

Convert from array to list. Returns a fixed size list that works with the specified array. Therefore, it cannot be added or removed. (An exception "UnsupportedOperationException" is thrown when trying to add or remove)

Difference from List.of (of method of List interface)

Both generate a fixed length list. AsList is a mutable (variable) that can change elements (set), List.of is immutable and immutable.

2. compare method

Compare the order when the two arrays are arranged in dictionary order (alphabetical order). 0 if the two arrays passed as arguments are equal, If the first argument is lexicographically ahead of the second argument, then a negative value, If the second argument comes first, it returns a positive value.

equals method

Returns true if the methods that check if the two arrays are equal are equal.

3. mismatch method

Compare the elements of the two arrays passed as arguments in order from the beginning. Returns the subscript (index) of the element that did not match first. Returns -1 if all elements match.

Finally

Both are methods introduced in Java 9. I wish I could have included the sample code, I'm glad I was able to organize my mind.

reference

Java SE 11 & JDK 11 Arrays [Thorough capture Java SE 11 Silver problem collection](https://www.amazon.co.jp/%E5%BE%B9%E5%BA%95%E6%94%BB%E7%95%A5Java-SE- 11-Silver% E5% 95% 8F% E9% A1% 8C% E9% 9B% 86-1Z0-815 / dp / 4295007625 / ref = sr_1_1? __mk_ja_JP =% E3% 82% AB% E3% 82% BF% E3 % 82% AB% E3% 83% 8A & crid = 292UROQ3DD33J & dchild = 1 & keywords = java + silver & qid = 1604741554 & sprefix = Java% 2Caps% 2C260 & sr = 8-1)

Recommended Posts

[Java SE 11 Silver] Arrays class method summary [Java beginner]
[Qualification Exam] Java SE 8 Silver Learning Method Summary
[Beginner] Java method / class / external library [Note 23]
[Java] Instance method, instance field, class method, class field, constructor summary
Passed Java SE8 Silver
[java] Java SE 8 Silver Note
Java programming (class method)
[Beginner] Java class field method / encapsulation (getter setter) [Note 25]
[Java Silver] Study method that passed Java SE 8 Silver [Passing experience]
Summary of knowledge required to pass Java SE8 Silver
[Experience] Passed Java SE 8 Silver
Progate Java (Beginner) Review & Summary
Java Silver Study Method Memo
[Java Silver] About equals method
Java SE8 Silver Pass Experience
Summary of Java Math class
[Java Silver] Array generation method
How to study Java Silver SE 8
[Java] Object-oriented syntax --class method / argument
Road to Java SE 11 Silver acquisition
[Java beginner] == operator and equals method
Diary for Java SE 8 Silver qualification
Java beginner design pattern (Factory Method pattern)
[Qualification] Java Silver SE11 Passing Experience
[Java Silver] Summary of access modifier points
Java method
Java Silver exam procedure and learning method
java beginner 4
Java SE8 Silver ~ The Road to Pass ~
How to use submit method (Java Silver)
Oracle Certified Java Silver SE 8 Passing Experience
java beginner 3
java beginner
Java SE 8 Silver (Java SE 8 Programmer I) Pass Note
Java method
Class method
[Java] method
The story received by Java SE11 silver
[Java] method
Java method call from RPG (method call in own class)
Is Java SE8 Silver useful for Java development work? ??
Java starting from beginner, class declaration / object generation
[Java certification] Freshly picked! SE 11 Silver Passing Experience (2020/12/26)
How to use the replace () method (Java Silver)
[Java beginner] println method without collection type specification
Java class methods
Java knowledge summary
[Java] Class inheritance
Java Generics Summary
Java SE Overview
java Scanner class
Java Silver memo
Java HashMap class
[Java] About arrays
Java related summary
java (abstract class)
Java8 method reference
[Java] Nested class
Java SE 7 memo
Java anonymous class
[Java] forEach method