current location:Home > Technical Articles > Java > JavaBase

  • How to determine whether a string is in date format in java
    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 5577 2019-12-05 11:56:07
  • Solution to garbled database data in java
    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 2605 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
    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 13955 2019-12-05 11:53:05
  • How to generate random unique numbers in java
    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 3050 2019-12-05 11:51:33
  • What principles should be followed when designing interfaces in java
    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 3187 2019-11-23 10:15:36
  • Java web page garbled solution
    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 1970 2019-11-23 10:00:27
  • Java determines what day of the week a specified date is
    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 4039 2019-11-23 09:43:44
  • Java determines whether an object is a string
    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 11246 2019-11-23 09:35:22
  • How to determine equality in java
    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 3775 2019-11-23 09:17:39
  • Determine whether a string is Chinese in java
    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 2616 2019-11-22 17:12:54
  • How to delete files and directories in java
    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 12984 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
    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 11061 2019-11-22 16:55:58
  • How to set the size of button with picture in Java
    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 3076 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
    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 4077 2019-11-22 16:37:25
  • How to end if loop in java
    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 6039 2019-11-22 16:29:20

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!