current location:Home > Technical Articles > Java > JavaBase

  • Java uses regular rules to determine whether it is a number
    Java uses regular rules to determine whether it is a number
    Java regular method to determine whether a string is a number: first define the regular expression "^-?\\d+(\\.\\d+)?$", and then use the matches() method to detect whether the string matches the given regular expression You can use the formula to determine whether it is a number.
    JavaBase 4838 2019-12-28 09:27:51
  • Java method to determine whether socket is disconnected
    Java method to determine whether socket is disconnected
    How to determine whether the socket is disconnected in java: You can use the sendUrgentData method in the socket class to determine whether the SO_OOBINLINE attribute of the socket is turned on. An exception will be thrown in java.
    JavaBase 3090 2019-12-27 16:51:28
  • Solution to Chinese garbled characters in Java database
    Solution to Chinese garbled characters in Java database
    Solution to Chinese garbled characters in Java database: Add useUnicode=true&characterEncoding=UTF-8 parameters after the URL configured in the database to solve the problem of database garbled characters.
    JavaBase 3815 2019-12-27 16:31:46
  • How to determine whether two dates are the same day in java
    How to determine whether two dates are the same day in java
    How to determine whether two dates are on the same day in java: 1. Use the Calendar.YEAR and Calendar.DAY_OF_YEAR methods to determine whether two dates are on the same day in the same year. 2. Use SimpleDateFormat to format the two dates, and then use equals to judge.
    JavaBase 11690 2019-12-27 16:13:58
  • Java determines whether a date is a weekend
    Java determines whether a date is a weekend
    Use the "get(Calendar.DAY_OF_WEEK)-1" method to obtain the number corresponding to the specified date. When the obtained number is 0 or 6, it means that the date is a weekend. In Java, you can use the Calendar.DAY_OF_WEEK method to get the number corresponding to the day of the week for a specified date, 1-7 corresponds to Sunday to Saturday.
    JavaBase 4203 2019-12-27 15:39:00
  • What is the difference between wait and sleep in java?
    What is the difference between wait and sleep in java?
    The difference between wait and sleep in Java: 1. Sleep comes from the Thread class, while wait comes from the Object class; 2. The sleep method does not release the lock, but the wait method releases the lock, allowing other threads to use synchronization control blocks or methods.
    JavaBase 4729 2019-12-27 15:31:17
  • Java method to determine whether string is a number
    Java method to determine whether string is a number
    How to determine whether a string is a number in Java: Use the charAt() method in a loop to return the characters in the string one by one, and then use the isDigit() method to determine whether the specified character is a number.
    JavaBase 13832 2019-12-27 14:50:58
  • What is the difference between html and java?
    What is the difference between html and java?
    HTML and java are essentially different. Java is an object-oriented programming language, and html is hypertext markup language. It is a markup language, not a programming language, and is used in almost all web pages.
    JavaBase 5552 2019-12-27 14:44:32
  • How to create a folder in java
    How to create a folder in java
    In Java, you can use the mkdir() method to create a single folder. When using this method to create a directory, you must ensure that its parent folder exists. Or use the mkdirs() method to create a multi-level directory. This method does not require ensuring that its parent folder exists.
    JavaBase 10564 2019-12-27 14:37:30
  • Is there any difference between c syntax and java syntax?
    Is there any difference between c syntax and java syntax?
    There are differences between c syntax and java syntax, for example: 1. C language has pointers, but java does not have pointers. 2. The identifiers available in C language are numbers, uppercase and lowercase letters, and underscores, which cannot start with a number. In addition to the three types of identifiers in C, the identifiers available in Java have one more dollar sign ($), which also cannot start with a number.
    JavaBase 3089 2019-12-27 14:29:16
  • How to get ip address in java
    How to get ip address in java
    How to get IP in java: You can return the IP address through the HttpServletRequest object, where the getRemoteAddr method returns the IP address of the client that made the request, and the getLocalAddr method returns the IP address of the WEB server.
    JavaBase 7728 2019-12-27 14:27:11
  • What is the difference between java collection and array?
    What is the difference between java collection and array?
    Differences: 1. An array declares the type of elements it contains, while a collection does not. 2. Arrays are static. An array instance has a fixed size. Once created, the capacity cannot be changed. Collections can dynamically expand their capacity and change their size dynamically as needed. Collections provide more member methods to meet more needs.
    JavaBase 8357 2019-12-27 14:06:09
  • Solutions to garbled characters in imported java projects
    Solutions to garbled characters in imported java projects
    Solution to garbled characters when importing java projects: 1. Right-click properties on the project, select Resource, and change Text file encoding. 2. Select Window-preferences-General-Workspace in the IDE and modify the encoding.
    JavaBase 4004 2019-12-27 13:50:52
  • Java method to determine whether a string contains specified characters
    Java method to determine whether a string contains specified characters
    How to determine whether a string contains specified characters in Java: Use the contains method to determine if and only if the string contains the specified char value sequence, the contains() method returns true.
    JavaBase 10854 2019-12-27 13:36:14
  • How to package java program
    How to package java program
    Packaging java program: 1. Select the class or package you want to export in eclipse, right-click and select the Export sub-option. 2. In the pop-up dialog box, select the java file-JAR file-click next. 3. Select the storage location of the jar package and save it.
    JavaBase 6273 2019-12-27 13:25:35

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