current location:Home > Technical Articles > Java > JavaBase
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- Analysis of the reasons why $ should not be used in Java classes
- This article introduces to you the reasons why $ is not used in classes in Java. I hope it will be helpful to students learning Java. Java identifiers consist of letters, numbers, currency symbols (¥, $, etc.), and connection symbols (_, etc.). But sometimes when you use $ easily, you will get unexpected surprises.
- JavaBase 2825 2019-11-30 14:43:59
-
- Java file operation-get file or directory information
- This article introduces how to obtain file or directory information from the Java Programming Introduction column. I hope it can help students in need. When obtaining file or directory information, you generally need to first determine whether the file or directory exists, and then use "isFile", "isDirectory" and other methods to make the corresponding determination.
- JavaBase 2735 2019-11-30 13:39:46
-
- How to determine whether a multi-level path exists in java and create it if it does not exist
- The way to determine whether a multi-level path exists in "java" and create it if it does not exist is: first segment the path by characters and save the result into an array, then instantiate the "StringBuffer" class, and then use the "if" statement to further determine, If the path does not exist, just create the directory.
- JavaBase 2328 2019-12-02 09:08:43
-
- There are several ways to create objects in java
- There are four ways to create objects in "java", which are: Method 1, use the "new" keyword to create objects; Method 2, use the reflection mechanism to create objects; Method 3, use the "clone" method to create objects; Method 4, Create objects using deserialization.
- JavaBase 2877 2019-12-02 09:09:49
-
- Solution to Chinese garbled java file name
- Solution to Chinese garbled file names in Java: 1. Use the encode(formFileName, "UTF-8") method to change the file name encoding. 2. Use the String(formFileName.getBytes("UTF-8"), "ISO-8859-1") statement to solve the problem.
- JavaBase 4913 2019-12-11 17:25:08
-
- Solution to garbled data inserted into mysql using java
- Solution to garbled data inserted into mysql by java: 1. Set the encoding of java and mysql environments to be the same. 2. When creating the mysql database, set the encoding format to utf-8. 3. When connecting to the database, add the specified encoding format after the url to solve the problem of garbled characters.
- JavaBase 2312 2019-12-11 17:24:36
-
- What are the methods in Java to determine whether a string contains a specific string?
- The methods in "java" to determine whether a string contains a specific string are: method 1, "startsWith" method, which is used to detect whether the string starts with the specified prefix; method 2, "contains" method, if and only Returns "true" when the string contains the specified sequence of "char" values.
- JavaBase 16832 2019-12-02 09:11:15
-
- What does == symbol mean in java
- "==" in Java is a relational operator, used to check whether the values of two operands are equal. If equal then the condition is true. For basic data types, == indicates whether the values are equal. For object data types, == indicates whether the address values are equal.
- JavaBase 17052 2019-12-11 17:23:55
-
- Java method to determine whether it is an IP
- Java can use matcher to match the regular expression "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]) (\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}" to judge .
- JavaBase 2859 2019-12-11 17:23:16
-
- How to determine whether key exists in map collection in java
- The method in "java" to determine whether "key" exists in the "map" collection is: first instantiate a "map" object, then add several elements to the collection for determination, and then use the "containsKey" provided by "java api" Method to judge or loop through, just compare one by one.
- JavaBase 6009 2019-12-02 09:12:00
-
- Solution to string garbled characters in java
- Java can transcode strings to solve string garbled characters. Use String(str.getBytes(charsetName), "utf-8") to change the string encoding format. charsetName is the original character encoding, and "utf-8" converts str to utf-8 encoding.
- JavaBase 4379 2019-12-11 17:22:32
-
- Java method to determine whether it is json
- Java can determine whether the data is in json format through exceptions. Use the JSONObject.parseObject (String str) method in try..catch to operate on json format data. If it is not json format data, false will be returned.
- JavaBase 4547 2019-11-30 10:09:46
-
- Java uses if statement to determine whether a string is empty or null
- The way "java" uses the "if" statement to determine whether a string is empty or "null" is: first distinguish the empty string and the "null" string, then determine whether it is the empty string by the length of the string, and then use "! The =" operator can determine whether the string is "null".
- JavaBase 5042 2019-11-30 09:55:20
-
- Java determines whether a string is a number
- How to determine whether a string is a number in Java: 1. Loop through the string, and then use the isDigit() function to determine whether a single character is a number. 2. Use the regular expression "^[-\\+]?[\\d]*$" to judge. 3. Judge by throwing exceptions.
- JavaBase 2627 2019-11-30 09:53:28
-
- Java calculates the day of the week a date is
- How to calculate the day of the week for a specified date in java: 1. Use the Calendar class to get the day of the week based on the date. This method returns a number from 1 to 7, representing the number of weeks from Sunday to Saturday. 2. Use the SimpleDateFormat class to get the day of the week for the specified date. Use the parameter EEEE to get the day of the week.
- JavaBase 4646 2019-11-30 09:43:08