close

MOST POPULAR

Sorry, Posts you requested could not be found...

MOBLIE

Sorry, Not enough posts for this block, please add more posts...

APPLICATIONS

Sorry, Not enough posts for this block, please add more posts...

- Advertisement -
DailyTechWorld

LATEST REVIEWS

Editors' Take

Sorry, Posts you requested could not be found...

Sorry, Posts you requested could not be found...

- Advertisement -
DailyTechWorld

THE LATEST

ReviewTech

Dyson Digital Slim Experience: Lightweight flagship

In my opinion, Dyson’s greatest contribution to mankind is not to make girls curl more natural, but the vacuum cleaners they make.

The V11 cordless vacuum cleaner is undoubtedly the master of this category, regardless of the suction power of up to 185 AW, the battery life of up to 1 hour or the price.

If you have to pick faults, V11 may have deeply hit the three major pain points of contemporary young people: not that big house, not that big arm, and not so much money.

Dyson, who knows the aspirations of consumers well, decided to launch a vacuum cleaner that combines performance and weight with a price conscience-Dyson Digital Slim, a lightweight cordless vacuum cleaner.

  • Lightness is a kind of productivity in itself

From carrying the box upstairs to unpacking and playing, the first impression Digital Slim gave me was that it was light and so good.

Although not marked with the V series, this Digital Slim shows the shadow of the predecessor V11 everywhere. It has a similar appearance, the same horizontal dust bucket design, and is also equipped with an LCD screen.

Compared with V11, the weight of the Digital Slim is reduced by 30%. In the handheld mode, it is only 1.9kg, and the volume is reduced by 20%.

In order not to become a fitness equipment, Dyson did not clean up any inventory parts this time, but redesigned all the components. For example, the fuselage adopts an integrated molding design, the fuselage and the hand-held handle are combined into one, and the vacuum rod becomes shorter and thinner.

Even the volume and weight of the main tip have been reduced by 40%, which is actually a key to the user experience. Many people choose not to sweep the floor robot, because the flexibility of the vacuum cleaner can be artificially cleaned in more complex scenes. This requires frequent lifting of the suction head, bypassing the power strips and cables, and crossing the threshold and steps. The brush head is the furthest away from the fulcrum, and every lighter, it can be doubled easily.

Dyson didn’t let go of the fulcrum. Digital Slim redesigned the buttons and handles. The buttons became a curved design that fits the fingers. The diameter of the handle was shortened, and a groove was made under the handle.

If you use Dyson for a long time, you will find that every time you lift the vacuum cleaner with one hand, you actually use your middle finger and index finger as a fulcrum. When the handle of Digital Slim is held, the index finger can be tightly attached to the button. Obviously save effort when exerting force.

With a lighter weight, a shorter vacuum rod, a better grip, and a more flexible operation, Digital Slim is very friendly to girls and elderly people with delicate statures. Even for me who has used V11 for a long time, Digital Slim has given me some unexpected value.

V11 is basically a land weapon to me. After all, it is not easy to lift a nearly two kilogram weight over my head. Digital Slim allows me to covet the old gray on the wall. The idea of ​​cleaning up was started.

Being light is a kind of productivity in itself.

Light without sacrificing suction

The motor is the key to driving the impeller to produce vacuum suction. Its speed determines the core ability of vacuuming-suction power.

This time, the Hyperdymium rotating speed motor of Digital Slim is 15% smaller than that of V11, but the speed is still as high as 120,000 rpm, which can drive 100AW of suction.

If you only look at the nominal parameters, 100AW is in the first echelon of vacuum cleaners, but it is not the highest in Dyson’s own home, even less than its own V8, let alone V11’s outrageous 185AW.

Is the suction power of 100AW enough?

I evenly mixed 5g of oatmeal, 5g of millet, and 5g of salt to simulate daily garbage. I used V11 and Digital Slim to perform two rounds of vacuum tests on the tiled floor respectively.

From the naked eye, the cleaning ability of the two is the same. The slight difference is that when inhaling oatmeal with larger particles, Digital Slim may bounce the oatmeal due to the relatively narrow air intake, while V11 is calmer.

▲ Digital Slim

▲ V11

For cleaning tiles or wooden floors, the suction power of 100AW is actually more than enough. You know, sweeping robots on the market are usually only 30-40AW.

So to some extent, it is a bit redundant to use Dyson V11 to clean hard floors, but this does not mean that high suction power is meaningless. If you have the need for deep cleaning of the whole house, dust mite’s removal or large area carpet, you should try to buy more High-power products

Compared with the peak suction power, there is actually another core indicator that determines the vacuuming effect but is often overlooked, that is, the suction power attenuation. The fine dust sucked together with the garbage will not only block the filter, but may even enter the motor, resulting in a drop in suction. This is like when we are testing a mobile phone chip, we can not only look at the peak performance, but also look at its durability.

The “on protracted war” of suction is closely related to cyclone design. In fact, the principle of the vacuum cleaner is very simple. The dust is thrown around with tornado-like air, and then the big beads and small beads fall on the jade pan, fall into the dust bucket under the cyclone, and discharge clean air from the middle. In theory, the greater the centrifugal force, the better the separation effect.

Digital Slim adopts the horizontal dust collecting bin design since V10, which not only makes it easier to dump garbage, but also reduces airflow consumption and friction.

The size of the centrifugal force = mass x radius x angular velocity². When the dust quality is established, a larger airflow velocity and a smaller dust bucket radius can increase the speed and enhance the centrifugal force.

On the one hand, Digital Slim improved the width of the air inlet, increased the airflow speed, and reduced the friction of the airflow. This made the centrifugal force of a single cyclone even exceeded V11, reaching more than 100,000G.

  • Suction head, dust collector and battery life

As a part that directly deals with trash and dust, suction heads are often overlooked. Dyson Digital Slim is equipped with a slim soft velvet tip and several tips and accessories.

This time I got the matte purple Digital Slim Fluffy Extra. The standard slim soft velvet tip, electric mattress tip, bottom conversion tip, slit soft fur wide mouth dual purpose tip and accompanying tip holder. In addition, compared with the Fluffy version, there are 4 more tips and accessories-wide-mouth fabric tip, extension hose, narrow slit lighting tip and high-altitude conversion tip.

If you don’t have much need for cleaning the bed, high places, deep places and dark places, the basic version is enough.

This time, the standard bottom conversion head of the whole series is worthy of praise. It can more easily allow the suction head to penetrate deep under the furniture without making users “kneel their knees.”

However, due to the bendable nature of the conversion head, the first time it is operated, it is not as easy to control as the original one, so you need to be familiar with the operation.

Another improvement is that the tip of Digital Slim can be removed with bare hands, and does not need to be opened with a coin like V11.

Since Digital Slim targets hard floors, it is not equipped with the high-torque carpet nozzles on V11.

As for the filter, it is no different from V11, and it can still filter 99.97% of fine dust as small as 0.3 microns to avoid secondary pollution. Both the filter screen and the brush strip can be cleaned directly, including the narrow slot lighting tip.

As a user who used to pick hair from the cleaning dust bucket with bare hands, I especially value the design of dumping garbage.

Digital Slim continues the design of the horizontal dust bin since V10. This catapult-start design is easier to dump garbage than before V10, and dumping garbage is also cleaner. Compared to V11, the damping feel promoted by Digital Slim seems to be smoother, and the elasticity of the dust collector cover seems to be optimized.

In addition, like V11, Digital Slim is also equipped with an LCD screen, which can display the remaining power while switching between automatic, energy-saving and powerful modes, and can also monitor 12 states such as airway blockage or the need to clean up garbage.

It’s just that the switch button at the bottom of the screen has changed from metal to plastic.

The battery is also the key to Digital Slim’s “slimming”, reduced to 18650. Following the V11 Absolute Extra, Digital Slim unsurprisingly also adopts a replaceable battery design, which not only makes old Dyson users envy , but also reminds countless smartphone users nostalgic for the past.

With a button, the user can easily remove the battery module like a “magic clip” and charge it separately.

The measured Digital Slim single battery can run for 40 minutes in energy-saving mode, which is 20 minutes shorter than V11, the use time of medium mode is 28 minutes, and the use time of strong mode is about 9 minutes.

The battery life is not high in stand-alone mode, but because of the existence of the detachable battery, you can double the use time and expand the use area by replacing the “magic clip” in the middle. It not only solves the problem of portability, but does not reduce the dust collection area.

  • Digital Slim is the flagship of small cups in vacuum cleaners

Digital Slim is like the “small cup” flagship popular among smartphone manufacturers in recent years. The weight and price are greatly reduced, but the core performance is not sacrificed. As for the battery life problem that has always existed in the small cup, Digital Slim has also creatively solved it with the design of a removable battery.

It is not only suitable for users who have requirements for weight perception, even if they are used to reinstalling users, the invigoration of Digital Slim is an experience that can’t go back after using it.

For Dyson Digital Slim, a lightweight and compact vacuum cleaner, I also had the first hands-on experience.

In terms of appearance, Dyson Digital Slim and Dyson V8 Slim are similar in size and volume. Both the box and the actual size of the machine are much smaller than standard flagship versions such as V8 and V11.

For the same main compact Dyson V8 Slim, I have also experienced it before. For petite girls, Dyson V8 Slim is already a vacuum cleaner with a good experience, and at the same time, the price is relatively good. The positioning of Dyson Digital Slim is to be higher.

The design of Dyson Digital Slim is like a mini version of Dyson V11. The dust bin is also opened in the same way as the Dyson V11. It can easily penetrate into the trash can without causing any problems secondary pollution.

However, Dyson has also made some changes to the design on this model. For example, the cyclone part on the Dyson V11 uses the usual gray design, while the Dyson Digital Slim design has become more colorful Purple, with a metallic luster texture. I feel that it enhances the sense of refinement, this purple looks quite charming.

In a word, Dyson Digital Slim is mainly improved in terms of light weight and ease of use, and the core capabilities of digital motors, cyclones and suction are also the best in the current volume, considering different people, the environment used is more targeted.

If you think Dyson V11 is still a bit heavier, then this Digital Slim can take a good look.

read more
TechTutorial

How To Create A Combined Array And Fill A Two-Dimensional Array

This chapter introduces the basic concept of copying an array, a two-dimensional array and keywords for arrays. I believe you must have such a question when programming arrays. How to merge a array and b array into c array? What is the connection between two-dimensional array and one-dimensional array? You should understand these concepts after reading this tutorial.

Copy an Array

Copy the value of one array to another array

The specific code is as follows:

System.arraycopy(src, srcPos, dest, destPos, length)

src: source array

srcPos: the starting position of the data copied from the source array

dest: destination array

destPos: Copy to the start position of the target array

length: the length of the copy

The specific code is as follows:

public class array {

            public static void main(String[] args) {

        int a [] = new int[]{11,24,38,89,55,9};

        int b[] = new int[5];//A space of length 3 is allocated, but no value is assigned

        //Assign the first 5 bits of the a array to the b array through array assignment

        //Method one: for loop

        for (int i = 0; i < b.length; i++) {

                                    b[i] = a[i];

                        }

        ///Method two: System.arraycopy(src, srcPos, dest, destPos, length)

        //src: Source array

        //srcPos: The starting position of the data copied from the source array

        //dest: Target array

        //destPos: Copy to the start position of the target array

        //length: Copy length     

        System.arraycopy(a, 0, b, 0, 5);

        //Print out the content

        for (int i = 0; i < b.length; i++) {

            System.out.print(b[i] + ” “);

        }

    }

}

  • Exercise 1-Combine Arrays

First prepare two arrays, their length is a random number between 10-20, and initialize the two arrays with random numbers.

Then prepare the third array, the length of the third array is the sum of the first two

Merge the first two arrays into the third array through System.arraycopy

The specific code is as follows:

public class array {

    public static void main(String[] args) {

        int a[] = new int[(int) (Math.random() * 10)+10];

        for (int i = 0; i < a.length; i++)

            a[i] = (int) (Math.random() * 100);

        int b[] = new int[(int) (Math.random() * 10)+10];

        for (int i = 0; i < b.length; i++)

             b[i] = (int) (Math.random() * 100);

        System.out.println(“Contents of array a:”);

        for (int i : a) {

                                    System.out.print(i+” “);

                        }

        System.out.println();

        System.out.println(“Contents of array b:”);

        for (int i : b) {

             System.out.print(i+” “);

        }

        System.out.println();

        int c[] = new int[a.length+b.length];

        System.arraycopy(a, 0, c, 0, a.length);

        System.arraycopy(b, 0, c, a.length, b.length);

        System.out.println(“Contents of array c:”);

        for (int i : c) {

             System.out.print(i+” “);

        }

    }

}

The final output of the console:

  • Two-dimensional array

Firstly, we have to clarify the definition of a one-bit array.

One-dimensional array, each element in it is a basic type int.

The specific code is as follows:

int a [] =new int [] {1,2,3,4,5};

A two-dimensional array is based on a one-dimensional array, and each element in it is a one-dimensional array.

So, a two-dimensional array is also called an array of arrays.

The specific code is as follows:

int b [] [] = new int [] [] {

   {1,2,3},

   {4,5,6},

   {7,8,9}

};

  • Initialize a two-dimensional array

The specific code is as follows:

public class array {

            public static void main(String[] args) {

                           //Initialize a two-dimensional array

                           int[][] a = new int[2][3]; //There are two one-dimensional arrays, and the length of each one-dimensional array is 3

                           a[1][2] = 3;  //One-dimensional array can be accessed directly because space has been allocated

                           //Only a two-dimensional array is allocated

                           int[][] b = new int[2][]; //There are two one-dimensional arrays, and the length of each one-dimensional array has not been allocated yet

                           b[0]  =new int[3]; //The length must be allocated in advance before access

                           b[0][2] = 5;

                           //Allocate space while specifying content

                           int[][] c = new int[][]{

                                                   {1,2,4},

                                                   {4,5},

                                                   {6,7,8,9}

                           };

                }

            }

  • Exercise 2-two-dimensional array

Define a 5X5 two-dimensional array. Then fill the two-dimensional array with random numbers.

Find the largest value in this two-dimensional array and print out its two-dimensional coordinates.

The specific code is as follows:

public class array {

            public static void main(String[] args) {

                        int a[][] = new int[5][5];

                        // Initialize this array

                        for (int i = 0; i < a.length; i++) {

                                    for (int j = 0; j < a[i].length; j++) {

                                                a[i][j] = (int) (Math.random() * 100);

                                    }

                        }

                        // Print the contents of this array:

                        for (int[] row : a) {

                                    for (int each : row) {

                                                System.out.print(each + “\t”);

                                    }

                                    System.out.println();

                        }

                        int max = -1;

                        // Maximum coordinate

                        int target_i = -1;

                        int target_j = -1;

                        for (int i = 0; i < a.length; i++) {

                                    for (int j = 0; j < a[i].length; j++) {

                                                if (a[i][j] > max) {

                                                            max = a[i][j];

                                                            target_i = i;

                                                            target_j = j;

                                                }

                                    }

                        }

                        System.out.println(“The biggest one is:” + max);

                        System.out.println(“Its coordinates are[” + target_i + “][” + target_j + “]”);

            }

}

The final output of the console:

Arrays

Arrays is a tool class for arrays, which can perform functions such as sorting, searching, copying and filling. Greatly improve the work efficiency of developers.

The keyword application part of Arrays mainly has the following modules:

Copy of Range, to String (), sort, binary, Search, equals, fill. These keywords can realize the array assignment, convert the array to string, sort the array, search the array, judge whether two arrays are the same, and fill the array.

Using the method of combining arrays, the a and b arrays can be combined into a c array. After analyzing the concept of a one-dimensional array, a two-dimensional array can be constructed by combining multiple one-bit arrays.

read more
ReviewTech

Five Easy-To-Use Free Note-Taking Software

A good memory is not as good as a bad pen. I deeply agree with this sentence.

I think developing the habit of taking notes can be of great help to work and study.

​Different people have different habit of organizing notes. Some students will use various scientific methods to organize their notes, while some students prefer the habit of simple and clear notes.

Therefore, the choice of tools will be completely different:

  • Evernote
  • Weizhi Note
  • Youdao Cloud
  • Note OneNote
  • Sublime
  • notepad
  • notepad++
  • UE

Among many note-taking software, it is difficult to say which one is good and which one is bad. Different people have different preferences. Some people like powerful and rich functions and multi-platform synchronization. Then you can choose Evernote, Youdaoyun Note, and Weizhi Note. Some people prefer plain text editors like Sublime and notepad to take notes.

The above-mentioned note-taking software is very comprehensive, but there will be some small partners who will ask me privately, what are the useful note-taking software. It explains that the above is not enough to meet the needs of all students. In this article, I will introduce 5 other note-taking software besides the above software to give you more choices.

Typora

Typora gives you a seamless experience as both a reader and a writer. It removes the preview window, mode switcher, syntax symbols of markdown source code, and all other unnecessary distractions. Instead, it provides a real live preview feature to help you concentrate on the content itself.

Perhaps many people are already familiar with this software, but I would like to introduce it again.

Typora is a Markdown editor, and it is also a tool I mainly use to make notes every day.

Because it can meet my 3 requirements:

  • Minimalist
  • Start quickly
  • Support Markdown

I am a minimalist, so although Evernote and Weizhinote are very well-known and powerful, their messy interface and functions still keep me away.

All I need is a directory and an editor, and Typora can just meet these needs.

In addition, Typora starts up very quickly, which can be called a second opening, and can be opened at any time, very lightweight.

Simplenote

Simplenote is a simple, lightweight open source cross-platform cloud note-taking tool that can save notes and lists, supports Markdown, and has functions such as multi-person collaboration, historical versions, tags, and public sharing. The developer is Automattic, the parent company of WordPress.

Simplenote belongs to the kind of cloud notes with super simple functions. It does not support saving pictures, but supports quoting pictures in Markdown. Therefore, the pressure on the server side will be much less, and the cost will be lower, so it will be better free.

Simplenote is also a simple note-taking software, which is very similar to Typora, with a simple interface, Markdown support, lightweight and free.

However, it also has its own unique highlights:

  • Comprehensive support platform
  • Support multi-platform synchronization
  • history record

Simplenote supports a very comprehensive platform, it supports iOS, Android, Mac, Windows, Linux. Even as long as it supports a browser, it can be used.

In addition, Simplenote also supports multi-platform synchronization, and if you accidentally modify the content of the note, its history function can also help you restore to a certain time node.

Tomboy


Tomboy is a desktop note-taking application that can be used on Linux, Unix, Windows and Mac OS X at the same time. Simple to use, it can effectively help you organize your own knowledge and information.

Features:

  • Display text,
  • spell check,
  • automatic highlighting of website links and email addresses,
  • multiple font styles and sizes,
  • synchronization between multiple computers, backup and restore

Notezilla

NoteZilla is a sticky note creation app, available for multiple operating systems, that lets you put sticky notes over other apps, save them for later, insert images, and much more.

NoteZilla is very flexible in what it allows you to do with your sticky notes, and you can place them just about anywhere. You can even sync your larger notes between devices. While the basic interface is easy to use, however, some features can be a bit harder to find. Additionally, older computers, tablets and operating systems may struggle to run NoteZilla well with all of its features.

Notezilla is a note-taking software under Windows. You can put it on the desktop like a sticky note, and then you can set time reminders, alarm clock reminders and passwords for the notes. In addition, Notezilla also supports sending notes, which is very convenient for changing computers and traveling for office.

Joplin

Joplin is a completely free and open source note-taking software.

Joplin has something similar to Evernote, which is powerful, supports synchronization, and encrypts notes, but it is completely free.

Joplin also has the following features:

  • Support Windows, mac, Linux, iOS, Android all platforms
  • Support synchronization with OneDrive, Dropbox, etc.
  • Support to-do list
  • Support Markdown syntax
  • End-to-end encryption of notes

Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.

Notes exported from Evernote via .enex files can be imported into Joplin, including the formatted content (which is converted to Markdown), resources (images, attachments, etc.) and complete metadata (geolocation, updated time, created time, etc.). Plain Markdown files can also be imported.

The notes can be synchronised with various cloud services including Nextcloud, Dropbox, OneDrive, WebDAV or the file system (for example with a network directory). When synchronising the notes, notebooks, tags and other metadata are saved to plain text files which can be easily inspected, backed up and moved around.

The application is available for Windows, Linux, macOS, Android and iOS (the terminal app also works on FreeBSD). A Web Clipper, to save web pages and screenshots from your browser, is also available for Firefox and Chrome.

These five free note-taking software are very easy to use, you can choose any of them to take notes.

read more
TechTutorial

How Concise the Arrays Make the Realization of the Array!

In the previous chapters, you learned about the basic concepts of arrays and the learning of related codes for sorting, copying, and merging. In this chapter, the concept of Arrays is introduced to copy, arrange, search, and transform characters. The learning of related codes such as string can greatly improve work efficiency and make the code more concise.

1. Array Copy

Similar to using System.arraycopy for array copying, Arrays provides a copyOfRange method for array copying.

The difference is System.arraycopy, which needs to prepare the target array in advance and allocate the length. The copyOfRange only needs the source array, and by returning the value, you can get the target array.

In addition, it should be noted that the third parameter of the copyOfRange indicates the end position of the source array and cannot be obtained.

The specific code is as follows:

import java.util.Arrays;

public class essay1 {

            public static void main(String[] args) {

                        int a[] = new int[] { 11, 22, 78, 89, 15, 90 };

                        // copyOfRange(int[] original, int from, int to)

                        // The first parameter represents the source array

                        // The second parameter indicates the starting position (obtained)

                        // The third parameter indicates the end position (not available)

                        int[] b = Arrays.copyOfRange(a, 0, 3);

                        for (int i = 0; i < b.length; i++) {

                                    System.out.print(b[i] + ” “);

                        }

            }

}

2. Convert to String

If you want to print the contents of an array, you need to find one by one through a for loop, and print one by one.

But Arrays provides a to String () method, which directly converts an array into a string, so that it is convenient to observe the contents of the array.

The specific code is as follows:

import java.util.Arrays;

public class essay1 {

            public static void main(String[] args) {

                        int a[] = new int[] { 11, 22, 78, 89, 15, 90 };

                           String content = Arrays.toString(a);

                    System.out.println(content);

                }

            }

3. Sort

In the previous chapters, I have explained selection method sorting and bubble method sorting. Although the effect of array sorting can be achieved in the end, the process is often very complicated. In this chapter, the concept of Arrays is introduced, and a sort method is provided in the Arrays tool class, which only requires one line of code to complete the sort function.

The specific code is as follows:

import java.util.Arrays;

public class essay1{

public static void main(String[] args) {

    int a[] = new int[10];

    for(int i=0;i<10;i++)

    {a[i]=(int)(Math.random()*10);

    }

    System.out.println(“Before sorting:”);

    System.out.println(Arrays.toString(a));

    Arrays.sort(a);

    System.out.println(“After sorting:”);

    System.out.println(Arrays.toString(a));

}

}

4. Search

Query where the element appears.

It should be noted that before using binary Search to find, you must use sort to sort.

If there are multiple identical elements in the array, the search result is uncertain.

The specific code is as follows:

import java.util.Arrays;

public class essay1{

            public static void main(String[] args) {

                        int a[] = new int[] { 13, 52, 88, 82, 66, 9 };

                        Arrays.sort(a);

                        System.out.println(Arrays.toString(a));

                        //Before using binarySearch, you must first use sort to sort

                        System.out.println(“Where the number 52 appears:”+Arrays.binarySearch(a, 52));

            }

}

5. Judge Whether the Same

Compare whether the contents of two arrays are the same

The last element of the second array is 5, which is different from the first array, so the comparison result is false.

The specific code is as follows:

import java.util.Arrays;

public class essay1{

            public static void main(String[] args) {

                        int a[] = new int[] { 18, 62, 68, 82, 65, 9 };

                        int b[] = new int[] { 18, 62, 68, 82, 65, 5 };

                        System.out.println(Arrays.equals(a, b));

            }

}

 6. Filling

Use the same value to fill the entire array

The specific code is as follows:

import java.util.Arrays;

public class essay1{

             public static void main(String[] args) {

                    int a[] = new int[10];

                    Arrays.fill(a, 5);

                    System.out.println(Arrays.toString(a));

                }

            }

 7. Exercise-Two-dimensional Array Sorting

Firstly, define a 5X8 two-dimensional array, and then fill it with random numbers.

Sort two-dimensional arrays with the help of Arrays.

Reference ideas:

First copy the two-dimensional array to a one-dimensional array using System.arraycopy.

Then use sort to sort.

Finally, copy back to the two-dimensional array.

About random numbers:

There are many ways to obtain random integers ranging from 0 to 100. The following is one of the reference methods:

(int) (Math. random() * 100)

Math. random() will get a random floating-point number between 0-1, then multiply it by 100 and force it to an integer.

The specific code is as follows:

import java.util.Arrays;

public class essay1{

            public static void main(String[] args) {

        int a[][] = new int[5][8];

        for (int i = 0; i < a.length; i++) {

            for (int j = 0; j < a[i].length; j++) {

                a[i][j] = (int) (Math.random() * 100);

            }

        }

        System.out.println(“Print a two-dimensional array”);

        for (int[] i : a) {

            System.out.println(Arrays.toString(i));

        }

        //Copy two-dimensional array to one-dimensional array

        int b[] = new int[a.length * a[0].length];

        for (int i = 0; i < a.length; i++) {

            System.arraycopy(a[i], 0, b, i * a[i].length, a[i].length);

        }

        //Sort a one-dimensional array

        Arrays.sort(b);

        // Copy one-dimensional array to two-dimensional array

        for (int i = 0; i < a.length; i++) {

            System.arraycopy(b, a[i].length * i, a[i], 0, a[i].length);

        }

        System.out.println(“Print the sorted two-dimensional array:”);

        for (int[] i : a) {

            System.out.println(Arrays.toString(i));

        }

    }

}

The final output of the console:

8. Enhanced for Loop

Note: The enhanced for loop can only be used to obtain values, but not to modify the values in the array.

The specific code is as follows:

public class essay1{

            public static void main(String[] args) {

        int values [] = new int[]{18,62,68,82,65,9};

        //Conventional traversal

        for (int i = 0; i < values.length; i++) {

                                    int each = values[i];

                                    System.out.println(each);

                        }

        //Enhanced for loop traversal

        for (int each : values) {

                                    System.out.println(each);

                        }

    }

}

This is the learning content of the last chapter of arrays. After learning the concept of Arrays today, it will have a great impact on your array programming. The functions that previously required a few lines of code to achieve, after learning Arrays, only one line is needed. At the same time, the enhanced for loop learning content is also introduced in this chapter. I believe that through the learning of this chapter, your code will be more concise and effective.

read more