Home > Java > javaTutorial > body text

How to use java default access modifier

PHPz
Release: 2023-05-18 11:04:05
forward
937 people have browsed it

1. Variables and methods declared using the default access modifier are visible to the class. The variables in the interface are implicitly declared as public static final, and the access rights of the methods in the interface are public by default.

2. The declaration of variables and methods cannot use any modifiers.

Example

    String version = "1.5.1";
    boolean processOrder() {
        return true;
    }
Copy after login

What are the basic data types of java

The basic data types of Java are divided into:

1. Integer type , a data type used to represent integers.

2. Floating point type, a data type used to represent decimals.

3. Character type. The keyword of character type is "char".

4. Boolean type is the basic data type that represents logical values.

The above is the detailed content of How to use java default access modifier. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!