current location:Home > Technical Articles > Java > JavaBase
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- 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 5097 2019-12-30 16:08:57
-
- 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 5992 2019-12-30 15:53:39
-
- 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 4810 2019-12-30 15:27:16
-
- 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 8505 2019-12-30 15:08:42
-
- 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 4241 2019-12-30 14:15:16
-
- 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 3064 2019-12-30 13:57:14
-
- 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 11007 2019-12-30 13:44:24
-
- 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 2978 2019-12-30 11:35:38
-
- 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 2747 2019-12-30 09:43:02
-
- 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 3654 2019-12-30 09:24:07
-
- 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 4532 2020-01-04 17:40:17
-
- 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 26012 2022-03-31 17:43:48
-
- 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 2531 2019-12-28 16:29:51
-
- 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 6600 2019-12-28 16:05:31
-
- 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 4265 2019-12-28 15:41:16