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:
-
- Solution to java get garbled problem
- Java's get garbled solution: obtain the string in the background and convert the encoding, such as the common encoding ISO-8859-1 (String(name.getBytes("ISO-8859-1", "utf-8"))) This can solve the garbled get request.
- JavaBase 2864 2019-12-05 10:31:43
-
- How to determine whether the code is garbled in java
- Garbled characters will appear when submitting data in java. We can use the "java.nio.charset.Charset.forName("GBK").newEncoder().canEncode("test")" method to determine whether it is GBK encoding. Garbled characters.
- JavaBase 3277 2019-12-05 10:17:48
-
- Introduction to solutions to garbled files when reading files in Java
- Garbled characters when reading files in Java are caused by the inconsistency between the encoding used by Java and the encoding of the file being read. We can use FileReader's parent class InputStreamReader to read files and specify the encoding to solve the problem of garbled characters.
- JavaBase 3102 2019-12-05 10:07:41
-
- Reasons and solutions why the file cannot be found in java relative file path
- The reason why the file cannot be found in the relative file path of java: because the user working directory in the environment variables used in different running modes is different. Solution: Just modify the system environment variables (System.setProperty("user.dir", "C:\\XXX\\XXX");).
- JavaBase 3482 2019-12-05 09:52:21
-
- Solution to Java file compression garbled code
- Solution to garbled java file compression: For compressed files, when the file name is Chinese, if you use the class compression that comes with the JDK API, the file name will be garbled. In this case, just use the class in ant.jar in ANT. This problem can be solved.
- JavaBase 3053 2019-12-05 09:45:37
-
- Introduction to the method of determining whether a prime number is in Java
- How to determine whether it is a prime number in Java: first use the "src%2==0" statement to determine whether the number is an even number. If it is not an even number, pass it through the for (int i=3;i<=sqrt;i+=2) loop "src%i==0" determines whether it is a prime number.
- JavaBase 5170 2019-12-05 09:38:17
-
- Solution to error code 1603 when updating java
- Solution to error code 1603 when updating Java: 1. After the 1603 error occurs, restart the system and uninstall the old version, then download and install the offline installation package. 2. Disable Java content through Java Control Panel, then install a new version and re-enable Java content.
- JavaBase 22972 2019-12-05 09:25:34
-
- When to use static in java
- In "java", when a method or variable needs to be initialized and loaded, or is often called, you can add "static". Methods modified with "static" can be called directly with the class name, and those without "static" modification Methods must first instantiate an object before they can be called.
- JavaBase 4246 2019-12-04 17:59:09
-
- How is polymorphism implemented in java
- Polymorphism in "java" is achieved through dynamic binding, that is, the actual type of the referenced object is determined during execution, and then its corresponding method is called according to its actual type. The existence of polymorphism requires three necessary conditions, namely: first, there must be inheritance; second, there must be overriding; third, the parent class reference points to the subclass object.
- JavaBase 5894 2019-12-04 17:20:04
-
- How to define an interface in java
- The basic format of defining an interface in "java" is: "modifier + interface + interface name [extends + parent interface name list] {modifier + global constant; modifier + abstract method;}". It should be noted that defining an interface requires the use of "interface "keyword, only constants and abstract methods can be defined in the interface.
- JavaBase 7977 2019-12-04 16:56:52
-
- How many bytes does the int type occupy in java?
- The int type in java occupies 4 bytes. Byte is a unit of measurement used by computer information technology to measure storage capacity. It is a string of binary digits processed as a unit and is a small unit that constitutes information. The most commonly used byte is an octet, that is, it contains an eight-bit binary number.
- JavaBase 16434 2019-12-04 16:43:17
-
- Several ways to implement multithreading in java
- The way to implement multi-threading in "java" is: 1. Inherit the "Thread" class, create a class to inherit the "Thread" class, then rewrite the "run" method, and call the instance object of this class in the "main" method The "start" method is enough; 2. Implement the "Runnable" interface.
- JavaBase 4892 2019-12-04 16:43:08
-
- What does instance mean in java?
- An instance refers to an object implementation based on a certain class. This process is called instantiation. Instance generation method: 1. Use the new keyword to generate. 2. Use the newInstance method of the Class class. 3. Use the newInstance method of the Constructor class.
- JavaBase 6520 2019-12-04 16:31:47
-
- How to get the first non-repeating character in a string in java
- The method of "java" to obtain the first non-repeating character in a string is: first obtain the string data input by the user through the "Scanner" class, and then obtain the index and number of the last time a certain character appeared in the string. The index that appears in the string once can be determined by using the "if" statement.
- JavaBase 2740 2019-12-04 16:26:46
-
- java error: main class not found or unable to load solution
- Java error: The main class cannot be found or cannot be loaded. Solution: Use "java package name + class name" to solve the problem. This error occurs because the java command by default searches in the directory specified in the CLASSPATH environment variable when searching for the address of the class file.
- JavaBase 10310 2019-12-04 16:07:43