Several methods to find the maximum and minimum values in an integer array

In integer arrays, we need to get the maximum and minimum values of array elements from them: Method 1: Sort using Array first, then from the sorted array, the first element is the smallest and the last element is the largest.   public static int FindMaxNumber(params int[] stringValue) { Array.Sort(stringV ...

Posted by gmp on Sun, 19 Jul 2020 16:30:03 +0200

Mongodb update array $pull modifier

1. $pull modifier deletes qualifying elements from the array in the following format: { $pull: { <field1>: <value|condition>, <field2>: <value|condition>, ... } } 2. Specify a value to delete all lists Give a document under a stores collection { _id: 1, fruits: [ "apples", "pears", "oranges", "grapes", "bana ...

Posted by vex__ on Mon, 20 Jul 2020 16:51:29 +0200

CentOS7 installation configuration mongodb3.2

1. Download Dependent Packages yum -y install wget 2. Create a file directory mkdir -p /app/install mkdir–p /app/data/mongodb mkdir–p /app/log/mongodb 3. Download mongodb cd /app/install wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.16.tgz tar zxvf mongodb-linux-x86_64-3.2.16 ...

Posted by Collin on Mon, 20 Jul 2020 18:21:42 +0200

Kids learn Java (6): encapsulation

Object oriented has three characteristics: Encapsulation, Inheritance and Polymorphism. This section covers encapsulation. Procedure 1 class Woman { private String name; private int age; private Man husband; public void setName(String name) { this.name = name; } public String getName() { return ...

Posted by Japher on Sun, 19 Jul 2020 17:48:11 +0200

java annotations are easy to use

java annotations are easy to use Annotations have been used throughout the development process, and today I finally want to look at the implementation of annotations.Drive directly // Custom Notes // Annotation has been implemented here // Note that comments are only valid in the form of reflection calls @Retention(va ...

Posted by gotit on Mon, 20 Jul 2020 16:23:01 +0200