Home > Java > Java Basics > body text

What is the function of java method

Release: 2019-12-28 11:16:08
Original
4786 people have browsed it

What is the function of java method

The "Method" in Java language may also be called "Function" in other languages. For some complex code logic, if you want to reuse the code and "use it at any time", then you can put the code in curly brackets "{}" and give it a name. When using the code, just find the name and call it.

What is the method?

A Java method is a collection of statements that together perform a function.

A method is an ordered combination of steps to solve a type of problem

Methods are contained in classes or objects

Methods are created in the program and referenced elsewhere

Advantages and functions of the method:

1. Make the program shorter and clearer.

2. Conducive to program maintenance.

3. It can improve the efficiency of program development.

4. Improved code reusability.

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of What is the function of java method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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 [email protected]
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!