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:
-
- How to determine whether a string is in date format in java
- How to determine whether a string is in date format in Java: You can first define a regular expression to match the correct date format, and then use the matches() method to detect whether the string matches the regular expression in the specified date format. If it is a date format, it returns true.
- JavaBase 5685 2019-12-05 11:56:07
-
- Solution to garbled database data in java
- Solution to Java database garbled code: 1. Use the "CHARACTER SET 'utf8'" statement to set the encoding format when creating the database. 2. Add the "CHARSET=utf8" statement to set the encoding format when creating the table. 3. Set the encoding format when setting the url.
- JavaBase 2690 2019-12-05 11:54:13
-
- How to determine whether an array contains an element in java
- How to determine whether an array contains an element in Java: 1. Convert the array to a list, and then use the contains method of the list to determine. If it contains, this method returns true, otherwise it returns false. 2. Traverse the array and determine whether there is an element in the array that is equal to the specified element to determine whether it contains the specified element.
- JavaBase 14038 2019-12-05 11:53:05
-
- How to generate random unique numbers in java
- How to generate random non-repeating numbers in Java: Determine a minimum value min and a maximum value max, use the random() method to generate a non-repeating random array based on min and max, put all the numbers from min to max into the array, and then one by one The number taken out is a non-repeating random number.
- JavaBase 3145 2019-12-05 11:51:33
-
- What principles should be followed when designing interfaces in java
- When designing an interface in Java, you must first clarify the responsibilities of the interface, that is, the interface type, and then try to make the interface as single as possible to ensure that an interface only does one thing. Finally, you should clarify the interface protocol according to the specific situation, and determine whether to use the "HTTPS" protocol or "FTP" protocol.
- JavaBase 3268 2019-11-23 10:15:36
-
- Java web page garbled solution
- Solution to garbled web pages in Java: 1. Change the character set of the page in the jsp page to UTF-8 to solve the garbled web pages. 2. In java web projects, you can set the encoding format to solve garbled characters when obtaining values in post and get methods.
- JavaBase 2068 2019-11-23 10:00:27
-
- Java determines what day of the week a specified date is
- How to determine the day of the week for a specified date in Java: 1. Use the Calendar class to get the day of the week for the specified date. The week obtained by this method starts on Sunday. 2. Use the SimpleDateFormat class to format the date to obtain the day of the week. The parameter "EEEE" represents the day of the week.
- JavaBase 4141 2019-11-23 09:43:44
-
- Java determines whether an object is a string
- Java method to determine whether an object is a string: You can use the instanceof operator to determine whether the specified object is a real class of the string class to determine whether the object is a string. If the instanceof operator returns true, the object is a string, and if it is false, The object is not a string.
- JavaBase 11345 2019-11-23 09:35:22
-
- How to determine equality in java
- The methods for judging whether it is desired in Java are: 1. To judge whether the basic data types in Java are equal, you can directly use "==" to judge. If they are equal, it returns true, and if they are not equal, it returns false. 2. To determine whether a custom object is equal, you can override the equals() method in the object's class definition.
- JavaBase 3868 2019-11-23 09:17:39
-
- Determine whether a string is Chinese in java
- Unicode encoding can be used in java to determine whether a string is Chinese. The Unicode encoding range of Chinese is "0x4e00-0x9fa5" or decimal "19968-40869". In Java, you can determine whether the character is Chinese by looping through the string and comparing it with Unicode encoding.
- JavaBase 2750 2019-11-22 17:12:54
-
- How to delete files and directories in java
- In Java, you can use the "delete()" method to delete files or empty directories. If the file is deleted, it returns "true", otherwise it returns "false". However, when deleting a directory, only empty directories can be deleted successfully, and recursive deletion must be used. all files before the directory can be deleted.
- JavaBase 13084 2019-11-22 17:01:27
-
- How to determine whether a string is empty in java
- How to determine whether a string is empty in java: 1. Use str.length()==0 to determine whether the string is empty by determining whether the length of the string is 0. 2. Use the str==null statement to determine whether the string is empty by determining whether the string is null.
- JavaBase 11159 2019-11-22 16:55:58
-
- How to set the size of button with picture in Java
- The method to set the size of a button with a picture in Java is: first, in the project that requires graphical interface programming in Java, obtain the length and width of the setting button in advance, then use the "getScaledInstance()" method to reconstruct the picture, and then construct the "Icon" The object can be passed into "JButton".
- JavaBase 3182 2019-11-22 16:42:45
-
- How to determine whether a string is a number in java
- How to determine whether a string is a number in Java: 1. Traverse a string through a loop, and use the Character.isDigit method in the loop to determine whether the character is a number. 2. Use the regular expression "-?[0-9]+(\\.[0-9]+)?" to determine whether the string is a number.
- JavaBase 4170 2019-11-22 16:37:25
-
- How to end if loop in java
- The method to end the "if" loop in Java is: first, you can use the "break" statement to end the "if" loop, that is, not to continue executing all subsequent loops, and then you can also use the "continue" statement to end the current loop of the "if" statement. But just ending one level of loop does not affect the continued execution of subsequent loops.
- JavaBase 6128 2019-11-22 16:29:20