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 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
- 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?
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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)
- 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
- 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
- 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: 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
- 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