## Comparing two arrays for equality

In this post under Java, I will show with example how to check whether two arrays are equal or not. The class Arrays under java.util package has “equals” static method which takes two arrays as arguments and compare their contents to check whether they are same. Below is the code showing an example Main 1…… Continue reading Comparing two arrays for equality

## Sorting a section of an array

In this post I will explain how to sort a section of an array. The java Arrays class provides a static method named “sort” which takes the below three arguments 1) the array 2) fromIndex 3) toIndex This method sorts a section of the array. The section to be sorted is indicated by fromIndex (position…… Continue reading Sorting a section of an array

## Sorting arrays using Comparator

This post explains how to sort arrays using comparator with an example. The java jdk provides Arrays class, which has a static method named “sort”. This method takes two arguments 1) the array to be sorted 2) Comparator which contains the logic to sort the array Below is the example which sort cards based on…… Continue reading Sorting arrays using Comparator

## Different ways to convert list to array

This post explains two ways through which we can convert a list to array. First approach is simply calling toArrayList on list instance. This method returns an Object array, When converting to array it doesn’t consider the data type of the entries in the list. Below is the code snippet list.toArray(); The second approach involves…… Continue reading Different ways to convert list to array
{"ft_lang_label":"__label__en","ft_lang_prob":0.84334,"math_prob":0.6686002,"size":1585,"snap":"2023-40-2023-50","text_gpt3_token_len":320,"char_repetition_ratio":0.12966476,"word_repetition_ratio":0.03773585,"special_character_ratio":0.19747634,"punctuation_ratio":0.055555556,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95957357,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-07T04:09:23Z\",\"WARC-Record-ID\":\"<urn:uuid:5eeae531-dea0-49a4-801c-785aa369f815>\",\"Content-Length\":\"88216\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bdf192cb-eba4-4cb3-b44e-68bce8a8a3a2>\",\"WARC-Concurrent-To\":\"<urn:uuid:e751b2ee-1f5c-4c55-8291-85d4fce87d73>\",\"WARC-IP-Address\":\"192.0.78.225\",\"WARC-Target-URI\":\"https://coderecipes.blog/category/java/core/collections/\",\"WARC-Payload-Digest\":\"sha1:XAABJM3WFI7GZ63B7FVJCH5ZWRP2OAHM\",\"WARC-Block-Digest\":\"sha1:BOJZHJRKNINGFJYVLNTYNXKLJHZB4YO7\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100632.0_warc_CC-MAIN-20231207022257-20231207052257-00447.warc.gz\"}"}