current location:Home > Technical Articles > Java > JavaBase

  • Analysis of the reasons why $ should not be used in Java classes
    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
    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
    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 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 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 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?
    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
    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 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
    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
    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 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
    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
    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
    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

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