search
Home类库下载java类库Those modifiers in Java language

Those modifiers in Java language

Oct 20, 2016 am 10:48 AM
java

About those modifiers in the 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 (not Changed)

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

Three. Accessible scopes of 4 access levels

Those modifiers in Java language

Note: Top-level classes can only be modified by default modifiers and public , cannot be modified by private and protected

4. The abstract modifier can be used to modify classes and member methods

1. Use abstract-modified classes to represent abstract classes, abstract classes cannot be instantiated

2. Use abstract-modified methods to represent abstraction Methods, abstract methods have no method body: "{}", used for subclass rewriting

3. Abstract modified classes, 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. Modify with final The class cannot be inherited and has no subclasses

3. Methods modified with final cannot be overridden by methods of subclasses

4. Variables modified with final represent constants, such as (PI), so they can only be assigned once and cannot be Change

6.static modifier

1. Member variables modified with static represent static variables, which can be directly accessed through the class name

2. Member methods modified with static represent static methods, which can be accessed directly through the class name

3. Use the program modified with static to send code blocks. When the full name of Java Virtual Machine (JVM) is: Java Virtual Machine, it can locate them in the method of the runtime data area according to the class name, and it can only be run once



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft