Java basic Two < flow control statements, methods, arrays, Java memory structure > not yet ...

Source: Internet
Author: User

Talk not much, directly on the dry goods ...

One: Process Control statements

Break: Ends the current loop

Continue: End this cycle and continue the next cycle

Return: End method

Two: Methods

1. Features of the method:

A function defined in a class that has a specific function.

Methods are peer to method and cannot be defined in methods. Methods can only be called by methods.

2. Overloading of methods:

  In the same class, the method name is the same, the parameter list is different (the number is different, the corresponding type is different).

    Is independent of the return value type.
If the corresponding type is different, it is related to the order.
Independent of the variable name of the formal parameter

3. Rewrite the method:

Subclasses can inherit methods from the parent class without having to rewrite the same method. But sometimes subclasses do not want to inherit the parent class's methods, but want to make some changes, which requires a method of rewriting. Method overrides are also called method overrides.

Three: Arrays

  An array is a container that stores multiple elements of the same type. The elements in the array are automatically numbered from 0 for easy access.

Common format int[] arr = new INT[3]; Int[] arr = {A-i};

Java basic Two < flow control statements, methods, arrays, Java memory structure > not yet ...

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.