current location:Home > Technical Articles > Java > JavaBase

  • How to determine whether it is a number in java
    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 4043 2019-11-12 14:08:42
  • Solution to garbled characters when reading Chinese files in Java under Linux
    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 3164 2019-11-12 14:04:44
  • How to create and set a button in java
    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 16223 2019-11-12 13:51:18
  • How to delete elements from an array in JAVA?
    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 7227 2019-11-12 13:30:49
  • Solution to Chinese garbled characters when java adds data to mysql
    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 2140 2019-11-12 13:20:13
  • How to read data in java
    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 4340 2019-11-12 13:18:49
  • Detailed explanation of this keyword in Java
    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 2467 2019-11-12 13:08:35
  • How to upload files in java
    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 2953 2019-11-12 11:57:31
  • How to get unique random numbers in java
    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 2448 2019-11-12 11:46:01
  • How to solve garbled characters in java
    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 2141 2019-11-12 11:36:47
  • Does Java array have length method?
    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 4955 2019-11-12 11:30:33
  • What is the difference between interface and class in java
    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 4790 2019-11-12 11:29:36
  • What collection types are there in java?
    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 4474 2019-11-12 11:19:17
  • How to initialize arrays in Java
    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 5555 2019-11-12 11:17:05
  • How to configure java environment variables
    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 9807 2019-11-12 11:14:42

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