current location:Home > Technical Articles > Java > JavaBase

  • How to determine whether file exists in java
    How to determine whether file exists in java
    The method to determine whether "file" exists in "java" is: you can use the "file.exists" method in the "File" class to check. First, you need to import the "File" class, and then save the "file" path that needs to be determined to a In the object, just call the "exists" method at the end to make a judgment.
    JavaBase 3458 2019-11-27 10:01:25
  • Introduction to the method of determining whether a file exists in java (with code)
    Introduction to the method of determining whether a file exists in java (with code)
    In Java, you can use the file.exists() method of the File class to detect whether a file exists. exists() tests whether the file or directory represented by the abstract path name exists. If and only if the file or directory represented by the abstract path name exists, it returns true, otherwise it returns false.
    JavaBase 3447 2019-11-27 09:57:35
  • How to make double type data retain two decimal places in java
    How to make double type data retain two decimal places in java
    The way to keep two decimal places for "double" type data in "java" is: first, you can define an object to save the defined rounding mode, and then use the defined object to call the "format" method to combine the data that needs to be modified with the definition. The rounding mode can be matched.
    JavaBase 15665 2019-11-27 09:46:13
  • Java method to determine whether it is a date (code attached)
    Java method to determine whether it is a date (code attached)
    How to determine whether it is a date in Java: 1. First define a regular expression to determine the date, and then use the matches() method to match the regular expression to determine whether it is a date. 2. Use the SimpleDateFormat class to set the date format, and then determine whether it is a date by throwing an exception.
    JavaBase 6024 2019-11-27 09:46:01
  • Garbled characters appear when converting byte[] to String in java
    Garbled characters appear when converting byte[] to String in java
    The reason why "byte[]" in "java" is garbled when converted to "String" is due to different encoding standards. The solution is: you can use the common "Base64" encoding specification. The "Base64" encoding specification can convert common characters into 6-bit binary representation, so that standard conversion can be guaranteed.
    JavaBase 10567 2019-11-27 09:28:00
  • The reason why the specified path cannot be found when creating a file in java
    The reason why the specified path cannot be found when creating a file in java
    When creating a file, it prompts that the specified path cannot be found. This is because the directory has not been created. When you create a file, you should first create the file's parent directory and then create the file.
    JavaBase 7108 2019-11-27 09:23:58
  • Java question mark garbled solution
    Java question mark garbled solution
    Solution to Java garbled question marks: 1. Convert Chinese encoding format during output (String(str.getBytes("GB2312"), "8859_1");). 2. Convert the encoding format when reading from parameters, the method is opposite to that when outputting.
    JavaBase 4087 2019-11-27 09:15:35
  • How to determine whether a string is a decimal in java
    How to determine whether a string is a decimal in java
    The method to determine whether a string is a decimal in "java" is: first, by calling the "isBlank()" method to initially determine whether the string is empty or composed of blank characters, then define a regular expression for judgment, and finally by calling The "matches" method can determine whether a string is a decimal.
    JavaBase 4835 2019-11-26 17:42:58
  • How to determine what a string starts with in java
    How to determine what a string starts with in java
    The way to determine what a string starts with in "java" is: first define a variable to save the prefix string, and then call the "startsWith" method to determine. If the string starts with the specified prefix, "true" will be returned. Otherwise, "false" is returned.
    JavaBase 12070 2019-11-26 17:14:20
  • How to determine how many specified characters a string contains in java
    How to determine how many specified characters a string contains in java
    The way to determine how many specified characters a string contains in "java" is: first define a variable to save the number of occurrences of the specified character, then call the "indexOf" method to calculate the subscript of the specified character, and finally use "if" Just use the sentence to make a judgment.
    JavaBase 12696 2019-11-26 16:56:10
  • Characters in java are garbled
    Characters in java are garbled
    The reason why the characters in "java" are garbled is: the characters are garbled due to inconsistency between the encoding method and the decoding method. The solution is: first use the function "defaultCharset" to view the default character set used by the system, and then modify the decoding method to be the same as the encoding method.
    JavaBase 2649 2019-11-26 16:45:09
  • Introduction to java learning process
    Introduction to java learning process
    Java is a very popular language. Many people are learning Java now. We can easily find many Java tutorials on the Internet, but most of the tutorials we find on the Internet are scattered, which is not conducive to our Java learning. This article will introduce you to the learning process of java.
    JavaBase 3857 2019-11-26 16:35:28
  • How to determine whether a string contains a certain character in java
    How to determine whether a string contains a certain character in java
    The method to determine whether a string contains a certain character in "java" is: first, you can use the "contains" method, which returns "true" only if and only if the string contains the specified sequence of character values. Secondly, you can also use "indexOf" method, but the return value of this method is "int".
    JavaBase 9862 2019-11-26 16:32:14
  • Java collection class graphic tutorial
    Java collection class graphic tutorial
    Java collection classes are the basic knowledge in Java. Collections are mainly responsible for saving and holding other data. Therefore, collection classes are also called container classes. All collection classes are located under the java.util package. This article introduces us to the collection class in Java in detail, hoping to provide some help when you learn Java.
    JavaBase 2463 2019-11-26 16:16:18
  • Detailed explanation of transient keyword in java
    Detailed explanation of transient keyword in java
    Java provides a mechanism for object serialization. An object can be represented by a byte sequence that contains information such as the object's data, the object's type, and the attributes stored in the object. After the byte sequence is written to the file, it is equivalent to persisting the information of an object in the file. Conversely, the byte sequence can also be read back from the file.
    JavaBase 2180 2019-11-26 16:14:58

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