current location:Home > Technical Articles > Java > JavaBase

  • How to solve java servlet garbled characters
    How to solve java servlet garbled characters
    Solution to java servlet garbled code: 1. Use the setCharacterEncoding method to encode the received content. 2. Use the setContextType method to encode the content to be output and forwarded.
    JavaBase 2505 2019-11-21 17:04:18
  • How to determine whether an element is in an array in java
    How to determine whether an element is in an array in java
    Methods to determine whether an element exists in an array in Java: 1. Convert the array into a List, and then use the contains in the List to determine whether the element exists. 2. Use set to determine whether the element exists. 3. Use a loop to traverse the array to determine whether the element exists.
    JavaBase 13011 2019-11-21 16:52:35
  • What are the methods of assigning values ​​to arrays in java?
    What are the methods of assigning values ​​to arrays in java?
    The methods of assigning values ​​to arrays in Java are: 1. Use the direct assignment method, for example: "arr[0]=1"; 2. Use loop traversal to assign values ​​to the array, for example: "for (int num:arr)".
    JavaBase 17537 2019-11-21 16:42:50
  • Determine whether it is a leap year in java
    Determine whether it is a leap year in java
    In Java, you can use the year%4==0&&year%100!=0 and year%400==0 statements to determine whether it is a leap year. As long as the specified year meets these two conditions, it is a leap year.
    JavaBase 6890 2019-11-21 16:30:36
  • How objects are initialized in Java
    How objects are initialized in Java
    The object initialization process in Java: First, the static method of the class will be accessed to complete the initialization of the class, then the jvm will load the compiled file, generate a class object, then allocate sufficient storage space for the object, and finally complete the initialization of the method, the object The initialization is successful.
    JavaBase 3334 2019-11-21 16:14:02
  • How to determine whether an object is empty in java
    How to determine whether an object is empty in java
    Methods to determine whether an object is empty in java: 1. Use the StringUtils.isEmpty(CharSequence cs); method to determine. This method can only determine the String type. 2. Use StringUtils.isEmpty(Object str); method to judge.
    JavaBase 3950 2019-11-21 16:11:10
  • What are the methods to determine whether a string is empty in java
    What are the methods to determine whether a string is empty in java
    The methods to determine whether a string is empty in Java are: 1. Use the "equals()" method, for example: "if(s == null ||"".equals(s))"; 2. Compare the length of the string, For example: "if(s == null || s.length() <= 0)".
    JavaBase 3240 2019-11-21 15:58:49
  • How to determine the day of the week in java?
    How to determine the day of the week in java?
    How to determine the day of the week in java: You can use the DAY_OF_WEEK method provided in Calendar to get the day of the week. The date of the week obtained by DAY_OF_WEEK starts with Sunday.
    JavaBase 3712 2019-11-21 15:45:33
  • How to determine whether a character is a Chinese character in java
    How to determine whether a character is a Chinese character in java
    The method to determine whether a character is a Chinese character in Java is: first use the "valueOf()" method to return the object value of the character, then define a regular expression for judgment, for example: "[\u4e00-\u9fa5]", and finally use Just match using the "matches()" method.
    JavaBase 6821 2019-11-21 15:42:10
  • How to determine whether the specified key exists in the map collection object in java
    How to determine whether the specified key exists in the map collection object in java
    Java's method of determining whether a specified key exists in a map collection object: first define a map object, then add objects to the collection through the "put()" method, then define a specified key value, and finally pass "map.containsKey()" Just use the method to judge.
    JavaBase 3986 2019-11-21 15:19:48
  • Java determines whether it is Chinese
    Java determines whether it is Chinese
    How to determine whether it is Chinese in java: 1. Use the regular expression "[\u4e00-\u9fa5]" to determine whether it is Chinese. 2. Determine whether the character is Chinese by judging whether the Unicode encoding of the character is between 19968 and 40869.
    JavaBase 3585 2019-11-21 15:15:47
  • How to determine whether data is ip in java
    How to determine whether data is ip in java
    The method to determine whether the data is IP in Java is: first determine whether the length of the data matches the IP length, then define a regular expression, use the "compile" method to compile the regular expression and create a matching pattern, and then use the "matcher()" method according to Just match the pattern.
    JavaBase 2866 2019-11-21 15:03:34
  • Java determines whether a string is a date
    Java determines whether a string is a date
    How to determine whether a string is a date in Java: first specify the date format, and then use the DateFormat class or SimpleDateFormat class to determine whether it is the correct date format and whether it is a date.
    JavaBase 3205 2019-11-21 14:53:08
  • How to determine whether a string is in json format in java
    How to determine whether a string is in json format in java
    The method to determine whether a string is in json format in Java is: first format the string that needs to be processed, and then use the methods "startsWith()" and "endsWith()" to determine whether the first and last letters of the string are "{}" or "[]", if neither, it is not in json format.
    JavaBase 16581 2019-11-21 14:44:38
  • What collections are there in java
    What collections are there in java
    There are three main types of collections in Java: set, list and map. List: stores ordered and repeatable elements, set: stores unordered and non-repeatable elements, map: stores elements in key-value form.
    JavaBase 4346 2019-11-21 14:35:33

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