Lecture 3 What is the difference between final, finally, and finalize?

... final can be used to modify classes, methods, and variables. They have different meanings. nal-modified classes can not inherit extensions. Final variables cannot be modified, and final methods cannot be rewritten. (override). Finally is a mechanism that Java guarantees that the key...


Java for Web study notes (one for one) Spring security preparation (2) Authorization

... access scope and permissions are authorized. Principals and Identities In terms of Java, it is convenient to use java.security.Principal . The Principal will contain at least the authenticated user identity, such as the username, and possibly other information. In addition, the user's...


Swagger use and tutorial

... Because Spring Boot can be quickly developed, easy to deploy and other features, I believe that a large part of Spring Boot users will be used to build RESTful API. The purpose of building RESTful APIs is usually because of the multi-terminal reason, these terminals will share a lot of...


Tomcat set HTTP proxy

... tomcat has two startup methods, 1: direct startup.bat 2: register windows service through service.bat 方式1Set proxy : in bin directory Find catalina.bat add a line http and https proxy, replace host with ip set "JAVA_OPTS=-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=1080 -Dhttps.proxyHost...


When expressing an abnormal branch, use the if-else method (can be implemented using the guard statement, policy mode, or state

... to avoid subsequent code maintenance difficulties, if-else try not to exceed 3 layers, you can try to use the guard statement , strategy mode or state mode 卫句: We are splitting complex conditional expressions into multiple conditional expressions, such as a very complex expression,...


Demo

... foreword using SpringMVC to upload files: File upload function also plays an irreplaceable role in the website, here I will talk about the simple use of SpringMVC to achieve file upload. Here my configuration is like this: idea+maven+tomcat9+jdk8 I also put the demo of the project on...


About the use of dates in Java8

... Java8 provides a new date class that is thread safe. And a lot of business situations have a concrete realization. Directly paste the code /** * About the common operation of some business operations on the date, take localDate as an example. The rest of localDateTime is similar. * <...


FreeCodeCamp Factorialize a Number

... @Factorialize a Number Calculate the factorial of an integer If the letter n is used to represent an integer, the factorial represents the product of all integers less than or equal to n. 阶乘 is usually abbreviated as n! example: 5! = 1 * 2 * 3 * 4 * 5 = 120 factorialize(5) should return...


Java product purchase course handout _day12 (3)

... 1.1 built-in function Built-in function syntax format: variable +? + function name 1.1.1 Get the collection size We usually want to get the size of a collection, as shown below: We use the size function to achieve, the code is as follows: 共${goodsList?size} records 1.1.1 Converting a...


BIO, NIO, AIO difference and application scenario

... The basic situation of IO is briefly introduced. Java IO stream 简单回 We should be very familiar with IO, IO is not only for file operations, Network programming socket communication is IO operation. Input, output stream (InputStream, OutputStream) is used to read or write bytes, such as...