current location:Home > Technical Articles > Java > JavaBase

  • How to use if statement to determine whether strings are equal in java
    How to use if statement to determine whether strings are equal in java
    The way to use the "if" statement in "java" to determine whether strings are equal is: you can use the "==" or "equals" method, both of which can compare whether strings are equal, but the difference is that "==" comparison is whether the addresses of the two strings are equal, and the "equals" method compares whether the contents of the string objects are the same.
    JavaBase 17366 2019-11-27 11:55:09
  • How to use if statement in java to determine whether a string is empty or null
    How to use if statement in java to determine whether a string is empty or null
    The method of using the "if" statement in "java" to determine whether a string is empty or "null" is: first check whether the string to be determined is "null", and then determine whether the string is empty by calling the "length" method. Note that this process must first determine that the string is not "null", otherwise an error will be reported.
    JavaBase 7710 2019-11-27 11:30:00
  • Detailed explanation of determining whether it is a decimal in java (regular method)
    Detailed explanation of determining whether it is a decimal in java (regular method)
    How to determine whether it is a decimal in Java: first define the regular expression "(\\d+\\.\\d+)" (this article details the functions of each symbol of this regular expression), and then use the matches() method to match this regular expression Expression to determine whether it is a decimal.
    JavaBase 4897 2019-11-27 11:22:18
  • How to solve garbled http request in java
    How to solve garbled http request in java
    The method to solve the garbled "http" request in "java" is: you can use the "IOUtils" tool class, first open the connection with the "URL", then set the submission mode when sending the request, and then obtain the "InputStream" through the tool class Convert the stream to a string and set the encoding format.
    JavaBase 3207 2019-11-27 11:15:48
  • How to determine whether a character is a Chinese character in java
    How to determine whether a character is a Chinese character in java
    How to determine whether a character is a Chinese character in Java: In the Java program, use the matches() method to determine whether the character matches the regular expression "[\u4e00-\u9fa5]" to determine whether the character is a Chinese character. \u4e00-\u9fa5 is the encoding of the Chinese character. scope.
    JavaBase 3447 2019-11-27 11:09:10
  • Java method to determine whether it is a triangle (code attached)
    Java method to determine whether it is a triangle (code attached)
    Whether a triangle can be judged by judging whether the three side lengths can form a triangle, you can directly use the statement if(a+b>c&&a+c>b&&b+c>a) in the java program to judge whether the three side lengths can form a triangle. .
    JavaBase 13421 2019-11-27 10:59:19
  • How to check whether the specified file in ftp server exists in java
    How to check whether the specified file in ftp server exists in java
    The method in "java" to check whether the specified file exists in the "ftp" server is: first, you need to connect to the "ftp" server, then set the file type to binary, and set the encoding format, then extract the directory and file name of the absolute address, and finally check Just specify whether the file exists.
    JavaBase 4034 2019-11-27 10:49:05
  • Introduction to the method of java determining whether the specified element contains an array
    Introduction to the method of java determining whether the specified element contains an array
    How to determine whether the specified element is in the array in Java: 1. First convert the array into a list or set collection, and then use the contains() method to determine whether the specified element is included. 2. Use a loop to traverse the array to determine whether the array contains the specified element.
    JavaBase 2406 2019-11-27 10:36:04
  • How to make float type data retain two decimal places in java
    How to make float type data retain two decimal places in java
    The methods for retaining two decimal places for "float" type data in "java" are: 1. Use the "round" method for calculation, which returns the result in numeric format; 2. Use the "format" method for formatting, This method returns the result in string format.
    JavaBase 8779 2019-11-27 10:16:39
  • Solution to java error file not found
    Solution to java error file not found
    Solution to the java error that the file cannot be found: 1. Check whether the environment variables are configured correctly (use the javac command to output the help information to check). 2. Check whether the path of the executed file is correct. 3. Check whether the extension of the executed file is .java.
    JavaBase 16429 2019-11-27 10:13:45
  • 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 3381 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 3382 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 15504 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 5964 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 10479 2019-11-27 09:28:00

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