current location:Home > Technical Articles > Java > JavaBase

  • How to intercept the first digits of a string in java
    How to intercept the first digits of a string in java
    In Java, you can use the substring() method to intercept the first few digits of a string. The substring() method returns the substring of the string. Set the starting index to 0 in the substring() method to intercept from the beginning of the string.
    JavaBase 20003 2019-11-21 13:38:47
  • How to determine whether a file is empty in java
    How to determine whether a file is empty in java
    The way to determine whether a file is empty in Java is: first, you can create a file object to save the file path, and then use the return value of the "length" method to determine, such as: "file.length". If the file is empty, Then the "length" method will return 0.
    JavaBase 8203 2019-11-21 13:28:52
  • Is the file empty in java?
    Is the file empty in java?
    In Java, you can use the return value of the length() method to determine whether the file is empty. If the file does not exist or the file is empty, the length() method returns 0.
    JavaBase 2553 2019-11-21 13:27:16
  • How to determine whether an array is empty in java
    How to determine whether an array is empty in java
    The way to judge whether an array is empty in Java is: if it is a one-dimensional array, it needs to be judged based on the array length, such as "array.length"; if it is a two-dimensional array, it needs to be judged based on the array length of the first row, such as: "array[0" ].length", if the length is 0, the array is empty.
    JavaBase 6117 2019-11-21 13:17:23
  • Java determines whether it is a directory
    Java determines whether it is a directory
    In Java, you can use the exists() method to determine whether a file or directory exists, and then use the isDirectory() method to check whether the object is a folder. The return value of these two methods is of boolean type, if so, it returns true, otherwise it returns false.
    JavaBase 4726 2019-11-21 13:15:39
  • Java reads txt Chinese garbled characters
    Java reads txt Chinese garbled characters
    Solution to java reading txt Chinese garbled characters: 1. Set the java project and txt file encoding to be unified to utf-8. 2. Use InputStreamReader (new FileInputStream (fileUrl), "utf-8") to set the text to utf-8 encoding.
    JavaBase 3832 2019-11-21 12:01:28
  • Java determines whether an object is an array
    Java determines whether an object is an array
    The method for Java to determine whether an object is an array is: you can start from the prototype and use the "isPrototypeOf()" method to determine whether the array is in the prototype chain of obj, for example: "Array.prototype.isPrototypeOf(obj)", if so, then returns true.
    JavaBase 6396 2019-11-21 11:34:44
  • How to determine whether a file exists in java
    How to determine whether a file exists in java
    In Java, you can use the file.exists() method to determine whether a file exists. If the specified file or directory exists, TRUE will be returned, otherwise FALSE will be returned.
    JavaBase 5759 2019-11-21 11:26:32
  • Java determines whether a string contains numbers
    Java determines whether a string contains numbers
    Traverse a string in java and then use the java.lang.character.isDigit(); method to determine whether there are digits in it. The java.lang.character.isDigit(); method in java determines whether a character is a number.
    JavaBase 5282 2019-11-21 11:04:57
  • What is a lock in java
    What is a lock in java
    Java locks are used to control how multiple threads access shared resources. A lock can prevent multiple threads from accessing shared resources at the same time. The locks in Java include: synchronization lock, exclusive lock, fair lock, unfair lock, shared lock, and read-write lock.
    JavaBase 6344 2019-11-21 10:47:54
  • Java determines whether a string contains a certain character (string)
    Java determines whether a string contains a certain character (string)
    How to determine whether a string contains a certain string in Java: 1. Use the startsWith() method to determine. 2. Use the contains method to determine. 3. Use the indexOf method to judge.
    JavaBase 3834 2019-11-21 10:32:53
  • Java determines whether it is a number
    Java determines whether it is a number
    How to determine whether it is a number in java: 1. Use the isDigit() function to determine. 2. Use the regular expression "[0-9]*" to judge. 3. Use digital ASCII code value to judge. 4. Judgment by catching NumberFormatException exception.
    JavaBase 3884 2019-11-21 10:17:51
  • Java determines whether it is a decimal
    Java determines whether it is a decimal
    How to determine whether it is a decimal in Java: first convert a string of numbers into a string, and then use contains(".") to check whether there is a decimal point "." in the string to determine whether it is a decimal.
    JavaBase 2714 2019-11-21 10:05:04
  • Java uses regular expressions to determine whether the incoming data is a number
    Java uses regular expressions to determine whether the incoming data is a number
    Java uses regular expressions to determine whether the incoming data is a number: you can use the regular expression "-?[0-9]+(\\.[0-9]+)?" to determine, but if the incoming data is If there are many digits, you need to use the "BigDecimal" method for conversion at the same time.
    JavaBase 3893 2019-11-21 09:50:27
  • How to get data from keyboard in java
    How to get data from keyboard in java
    Methods to obtain data from the keyboard in Java: You can use the Scanner class to obtain keyboard data in Java. The code for obtaining keyboard data in Java is Scanner s=new Scanner(System.in);. System.in represents the keyboard device.
    JavaBase 4301 2019-11-21 09:48:25

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