#Fields are also called member variables, which reflect the state of the class, and changes in the state are implemented by methods in the class body.
Domains are member variables in a class, sometimes also called fields, and attributes all have the same meaning. A public domain is a domain that can be directly accessed in other classes, that is, it has a domain. For example:
class Test { private int a; // 这是一个私有域,只能在本类访问 public int b; // 这就是一个公有域了,可以在其它类中直接访问 // 这是保护域,这类域可以在本类及其子类,还有与在本类所在同一包下的其类 // 中直接访问 protected int c; }
Definition of domain: Define static properties of the class.
Fields must be defined directly in the class body and cannot be included in method definitions.
The format of domain definition is as follows:
[Modifier] Type name Domain name;
Note: The modifier part is optional and can be One or more combinations of the keywords public, protected, private, final, static, transient and volatile;
For more java knowledge, please pay attention to the java basic tutorial column.
The above is the detailed content of What is a domain in java. For more information, please follow other related articles on 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

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

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools