
There are several thread states in java
Java has 6 thread states: initial (NEW), running (RUNNABLE), blocked (BLOCKED), waiting (WAITING), timeout waiting (TIMED_WAITING), and terminated (TERMINATED). Use the new keyword to create a new thread, but the start() method has not been called. The thread is in the new state; the blocked state indicates that the thread is waiting for the monitor lock and is trapped in the state; the thread that enters the waiting state needs to wait for other threads to make a decision Some specific action (notification or interrupt).
Nov 24, 2022 pm 04:03 PM
What are the characteristics of java
Characteristics of Java: 1. Object-oriented; it has good support for classes, objects, inheritance, encapsulation, polymorphism, interfaces, packages, etc. in objects. 2. Platform independence; after the introduction of the virtual machine, the Java language does not need to be recompiled to run on different platforms. 3. Simplicity. 4. Interpretation and execution; when the program is run on the Java platform, it will be compiled into a bytecode file, and then it can be run on an operating system with a Java environment. 5. Support multi-threading and provide synchronization mechanism between multi-threads; 6. Distribution; 7. Robustness; 8. High performance; 9. Security.
Nov 22, 2022 pm 05:55 PM
What is the difference between heap and stack
Differences: 1. The heap space is generally allocated and released by the programmer; while the stack space is automatically allocated and released by the operating system. 2. The heap is stored in the second-level cache, and the life cycle is determined by the garbage collection algorithm of the virtual machine; while the stack uses the first-level cache, which is usually in the storage space when it is called, and is released immediately after the call is completed. 3. The data structures are different. Heap can be regarded as a tree, while stack is a first-in, last-out data structure.
Nov 22, 2022 pm 04:12 PM
What is the execution order of static code blocks, construction code blocks, and construction methods?
The execution order is: first execute the "static code block", then execute the "constructive code block", and finally execute the "constructive code block". Static code blocks are at the class level, while structural code blocks and construction methods are at the instance level, so the static code blocks are executed first; and because the structural code blocks are independent and must rely on a carrier to run, the structural code blocks need to be placed in the structure before method.
Jan 25, 2022 am 11:41 AM
Java annotations - Java's own configuration files
Author's message Hello, everyone, this is my first article. I hope to summarize the knowledge I have learned and share it with everyone. In the next period of time, I will release a series of entry-level articles such as Java and Python. Relevant articles should be shared in a systematic way, so that you can go further by laying a solid foundation. I hope you all will give me some advice!
Jan 06, 2022 pm 03:46 PM
What is the difference between scala and java
Differences: 1. Java needs to explicitly use return to return values; while scala's return is optional. 2. Class and method modifiers, scala defaults to public, and java defaults to protected. 3. Java supports interfaces; Scala does not support interfaces and uses traits.
Sep 23, 2021 pm 05:02 PM
What are memory leaks and memory overflows in java
A memory leak means that after a program applies for memory, it cannot release the allocated memory space. Memory overflow means that when the program applies for memory, there is not enough memory for the applicant to use; or it provides a storage space to store int data, but long data is stored, the result is that the memory is not enough, and an OOM error is reported. The accumulation of memory leaks will eventually lead to memory overflow.
Sep 22, 2021 pm 05:48 PM
What are the stages of jvm class loading process?
Class loading process: 1. Loading phase; 2. Verification phase; 3. Preparation phase, which mainly allocates memory and initializes class variables in the method area; 4. Parsing phase; 5. Initialization phase, the compiler will The declared static assignment variable and the static area are merged to generate the cinit method and called; 6. Use phase; 7. Uninstall phase.
Jul 27, 2021 am 11:43 AM
What file is r.java?
The R.java file is automatically generated by the compiler and does not require developers to maintain it. R.java will automatically include all resources in the current application and create corresponding IDs based on these resources. R.java can be simply understood as the resource dictionary of the current Android application.
Jul 27, 2021 am 11:25 AM
How to write constructor method in java
The constructor method in Java is written as "class class_name {public class_name(){} public ciass_name([paramList]){} ...//class body}". The method name must be the same as the class name, and the respective method parameters must be different.
Jul 23, 2021 pm 05:42 PM
What are the java containers?
java container:ArrayList、LinkedList、Vector、HashSet、LinkedHashSet、TreeSet、LinkedHashMap、TreeMap、ConcurrentHashMap、Hashtable etc.
Jul 23, 2021 pm 05:34 PM
What are the built-in objects of jsp?
The built-in objects are: 1. Request object; 2. Response object; 3. out object; 4. session object; 5. application object; 6. PageContext object; 7. Config object; 8. Page object; 9. Exception object.
Jul 09, 2021 pm 02:21 PM
What is the extension of java source file?
The extension of the java source file is ".java"; compile it with javac to generate a bytecode file with the suffix ".class" and save it in the same directory as the source program. If there are errors in the source code, they will be pointed out line by line. Error, correct the error and recompile until the ".class" bytecode file is generated.
Jul 09, 2021 am 10:38 AM
Is Java easy to learn? How long does it usually take to learn and train?
Generally speaking, Java training lasts for 3-6 months. People with some basic knowledge can quickly learn to master Java, which takes about 1-2 months.
Jul 06, 2021 pm 03:05 PM
Hot tools Tags

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version
Chinese version, very easy to use
