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 determine whether it is a number in java
- Java's way to determine whether it is a number: first write a try catch statement to catch the exception; then force the character to be converted to a number in the try statement; finally, the program does not catch the exception, indicating that it is a number.
- JavaBase 4086 2019-11-12 14:08:42
-
- Solution to garbled characters when reading Chinese files in Java under Linux
- Solution to garbled characters when Java reads Chinese files under Linux: 1. Run the command vi /etc/profile; 2. Add the configuration zh_CN.GBK; 3. Run the command source /etc/profile to reload the configuration; 4. Restart the java project.
- JavaBase 3187 2019-11-12 14:04:44
-
- How to create and set a button in java
- How to set a button in java: first import the java.awt and javax.swing packages; then create a new BorderLayout layout and create a JButton button to place on the layout; finally use the button method to set the button.
- JavaBase 16253 2019-11-12 13:51:18
-
- How to delete elements from an array in JAVA?
- Java arrays have a fixed length, so elements in the array cannot be deleted directly. You can delete elements of the original array by creating a new array and assigning the retained elements in the original array to the new array.
- JavaBase 7260 2019-11-12 13:30:49
-
- Solution to Chinese garbled characters when java adds data to mysql
- The reason why Chinese garbled characters appear when java adds data to the mysql database is that the character set is inconsistent. Solution: It only needs that the character set specified when creating the database table is consistent with the character set specified by the URL when setting up the database connection in Java.
- JavaBase 2169 2019-11-12 13:20:13
-
- How to read data in java
- How to read data in java: first use File to create a file object; then use FileInputStream and InputStreamReader to obtain the input stream; finally, read the data line by line through the readLine method of the BufferedReader class.
- JavaBase 4358 2019-11-12 13:18:49
-
- Detailed explanation of this keyword in Java
- The this keyword in Java points to a reference to the current object. Usage of this keyword: 1. this. attribute name, refers to accessing member variables in the class; 2. this. method name, accessing the member methods of this class; 3. this(), accessing the constructor method of this class.
- JavaBase 2484 2019-11-12 13:08:35
-
- How to upload files in java
- How to upload files in java: 1. Download the jar package of the common-fileupload upload component and introduce it; 2. Create a new UploadHandleServlet class that inherits from HttpServlet; 3. Use FileOutputStream to write data and save it.
- JavaBase 2976 2019-11-12 11:57:31
-
- How to get unique random numbers in java
- Methods to obtain non-repeating random numbers in Java: 1. Define a digital array; 2. Obtain random numbers through random digital array subscripts; 3. Assign the value of the random subscript of the digital array to the actual array; 4. Add the subscript to index The value is exchanged with the last value of the array index.
- JavaBase 2476 2019-11-12 11:46:01
-
- How to solve garbled characters in java
- Methods for solving garbled characters in Java: 1. When the file is encoded in utf-8, use the "javac -encoding utf-8" parameter for compilation; 2. If the web page is garbled, you need to specify the encoding method of the response header "Content-Type"; 3. Use getBytes Method to perform encoding conversion.
- JavaBase 2165 2019-11-12 11:36:47
-
- Does Java array have length method?
- There is no length() method for arrays in Java, only the length attribute. Array array.length returns the length of the array.
- JavaBase 4987 2019-11-12 11:30:33
-
- What is the difference between interface and class in java
- The difference between interfaces and classes in Java is: essentially, an interface is also an abstract class, but the interface only contains the definition of constants and methods, without the implementation of variables and methods.
- JavaBase 4810 2019-11-12 11:29:36
-
- What collection types are there in java?
- There are three main types of collections in Java: set, list and map. The objects stored in the List are ordered and repeatable; the objects stored in the Set are unordered and cannot be repeated; the Map collection stores key-value pairs, and the keys cannot be repeated, but the values can be repeated.
- JavaBase 4491 2019-11-12 11:19:17
-
- How to initialize arrays in Java
- Methods of initializing arrays in Java: 1. arrayName = new type[] {element1...}; 2. type[] arrayName={element1...}; 3. arrayName = new type[length].
- JavaBase 5581 2019-11-12 11:17:05
-
- How to configure java environment variables
- How to configure java environment variables: 1. Right-click the computer-Properties-Advanced system settings; 2. Click Environment Variables and click New under the system variables column; 3. Create a new JAVA_HOME variable with the value as the jdk installation path; 4. Edit the Path variable , just add the jdk\bin and jre\bin paths.
- JavaBase 9835 2019-11-12 11:14:42