current location:Home > Technical Articles > Java > JavaBase

  • How to compare strings in java without case sensitivity
    How to compare strings in java without case sensitivity
    In Java, you can use the equalsIgnoreCase() method to implement case-insensitive comparison of strings. The equalsIgnoreCase() method is used to compare a string with a specified object, regardless of case. If the given object is equal to the string, it returns true. Otherwise return false.
    JavaBase 5042 2019-12-30 16:08:57
  • How to solve the problem of garbled characters when reading csv files in Java
    How to solve the problem of garbled characters when reading csv files in Java
    Solution to garbled characters in java when reading CSV files: Use the InputStreamReader class in the BufferedReader class to specify the encoding format for reading CSV files. The InputStreamReader class uses the specified character set to read bytes and decode them into characters.
    JavaBase 5916 2019-12-30 15:53:39
  • How to determine whether ip is legal in java
    How to determine whether ip is legal in java
    In Java, you can first define a regular expression that matches the correct IP address, and then use the matches(regex) method to detect whether the given IP address matches the given regular expression to determine whether the IP is legal.
    JavaBase 4750 2019-12-30 15:27:16
  • The difference between interface and inheritance in java
    The difference between interface and inheritance in java
    The difference between java interface and inheritance: 1. They are decorated with different modifiers. 2. Multiple inheritance is not supported in JAVA, but it can be implemented using interfaces. 3. Inheritance can only inherit one class, but implements can implement multiple interfaces.
    JavaBase 8437 2019-12-30 15:08:42
  • Java determines whether a thread is running
    Java determines whether a thread is running
    In Java, you can use Thread.isAlive() to determine whether a thread is running. The Thread.IsAlive attribute indicates whether the thread is currently available. If the thread has been started and there are no exceptions currently, it is true, otherwise it is false.
    JavaBase 4166 2019-12-30 14:15:16
  • How to solve garbled characters when writing files in Java
    How to solve garbled characters when writing files in Java
    Java writing file solution: You can use OutputStreamWriter write=new OutputStreamWriter(new FileOutputStream(f), "UTF-8"); to specify the character set used when writing files.
    JavaBase 2999 2019-12-30 13:57:14
  • How to output java string
    How to output java string
    Strings in Java can be output using System.out.println(). System is a class, inherited from the root class Object, out is an object instantiated by the PrintStream class, and println() is a member method of the PrintStream class.
    JavaBase 10920 2019-12-30 13:44:24
  • Java determines whether a string is empty
    Java determines whether a string is empty
    How to determine whether a string is empty in Java: 1. Use "str!=null" to determine. Null means that the string does not point to anything. 2. Use "".equals(str) to judge. 3. Use the "str.length()!=0" method to determine.
    JavaBase 2909 2019-12-30 11:35:38
  • Solution to garbled request in java
    Solution to garbled request in java
    In Java, POST transmits garbled parameters through the request body, which can be solved by setting the encoding method of the response character stream to UTF-8. If the get mode is garbled, you can first set the request data to be encoded in ISO8859-1 mode, and then decrypt it in UTF-8 mode.
    JavaBase 2682 2019-12-30 09:43:02
  • The problem of json transmission data garbled in java
    The problem of json transmission data garbled in java
    Solution to the problem of json transmission data garbled in Java: 1. First encode the parameters with ISO-8859-1, and then decode them with utf-8. 2. If it is a general request, just configure the Chinese filter in web.xml.
    JavaBase 3550 2019-12-30 09:24:07
  • Java uses if statement to determine whether strings are equal
    Java uses if statement to determine whether strings are equal
    The way to use if statements in Java to determine whether strings are equal is: [if(s1.equals(s2))]. Since strings are object types, they cannot be judged by simple [==]. You need to use [equals]. Judgment, [equals] compares the contents of objects.
    JavaBase 4465 2020-01-04 17:40:17
  • What is a member variable in java
    What is a member variable in java
    In Java, member variables refer to variables defined in the variable part of the class body, also called attributes. Member variables are declared in the class, outside the method body, and are instantiated when the object is created; member variables can be accessed by methods, constructors in the class, and statement blocks of a specific class. If a member variable is not initialized when it is declared, the system will initialize the member variable with a default value.
    JavaBase 25913 2022-03-31 17:43:48
  • How to solve the problem of garbled characters in exported csv files using Java
    How to solve the problem of garbled characters in exported csv files using Java
    Solution to the garbled code in Java exported csv files: Files exported in CSV mode do not contain BOM information by default. This problem can be solved by setting the BOM identifier (byte stream starting with EF BB BF) for the content to be output.
    JavaBase 2458 2019-12-28 16:29:51
  • How to determine whether a java object is empty
    How to determine whether a java object is empty
    Methods to determine whether an object is empty in java: 1. Use the StringUtils class under the org.apache.commons.lang3 package to determine. 2. Use the Object class under the org.springframework.util package to judge.
    JavaBase 6543 2019-12-28 16:05:31
  • How to generate random numbers in java
    How to generate random numbers in java
    In Java, you can use the random() method in the Math class to generate random numbers. The return value of the random() method is [0.0-1.0), that is, a random number between 0.0 and 1.0 is generated.
    JavaBase 4201 2019-12-28 15:41:16

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!