Discuss those modifiers in Java language
1. Some modifiers provided in java, these modifiers can modify classes, variables and methods. Common modifiers in java are: abstract (abstract), static (static), public (public) ), protected (protected), private (private), synchronized (synchronized), native (local), transient (temporary), volatile (volatile), final (immutable)
2. The modifiers that modify the top-level class include abstract, public, and final, while static, protected, and private cannot modify the top-level class. Member methods and member variables can have multiple modifiers, while local variables can only be modified with final
Accessible scope of three.4 access levels
Note: Top-level classes can only be modified by default modifiers and public, and cannot be modified by private and protected
4. The abstract modifier can be used to modify classes and member methods
1. Modify with abstract The class represents an abstract class, and abstract classes cannot be instantiated
2. Use abstract-modified methods to represent abstract methods. Abstract methods have no method body: "{}", used for subclass rewriting
3.In classes modified by abstract, that is, abstract classes can have ordinary methods and abstract methods.
4. Abstract classes and abstract methods cannot be modified by the final modifier. abstract modifier and final modifier cannot be used together
5.Final modifier
1.final means "immutable", it can modify non-abstract classes, non-abstract member methods and Variables
2. Classes modified with final cannot be inherited and have no subclasses
3. Methods modified with final cannot be overridden by methods of subclasses
4.Use final The modified variable represents a constant, such as (PI), so it can only be assigned once and cannot be changed
6. static modifier
1. Member variables modified with static represent static variables, Can be directly accessed through the class name
2. Use static modified member methods to represent static methods, and can be directly accessed through the class name
3. Use static modified programs to send code blocks, when java virtual The full name of machine (JVM) is: Java Virtual Machine can locate them in the method of the runtime data area according to the class name, and it can only be run once.
The above is the Java language introduced by the editor. Those modifiers, I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!
For more articles discussing the modifiers in the Java language, please pay attention to the PHP Chinese website!

Hot AI Tools

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.
