The manager asked today about Java functions and scopes

Source: Internet
Author: User

1 Functions in Java: Methods
2 mathematical operators
1. Java method Methods (function functions), functions, actions
1) The method is the function: Y=f (x) =3x+6; 2)

Syntax of the method
(modifier words) (return value type) (Method Name) (parameter list) {
Method body
}
public static void Main (string[] args) {}
Such as:
public static int f (int x) {
int y = 3 * x + 4;
return y;
}
4) If there is a return value definition there must be a return statement, return and return value type
Compatible data
5) The parameters of the method and the variables inside the method are local variables,
These variables are scoped only inside the method!
6) Arguments: parameter variables that are actually passed when the method is called
Parameters: The parameter definition of a method, which is a temporary variable.

The manager asked today about Java functions and scopes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.