Fourth day of Java learning

Source: Internet
Author: User

The basic understanding of those logical languages, today comes to mind a problem is the difference between for and while, professionally, for and while are basically the same, but for is only allowed one access, if the end can not continue to access, while the while will be more than one access. Then there is the method, in Java I think the function is the method.

Format:
Modifier returns a value type method name (parameter type argument name 1, argument type parameter Name 2 ...) {
Method body Statement;
return value;
}

read the book I think the focus is the overloaded function, in the same class, the method name is the same, the parameter list is different. Is independent of the return value. Parameter list is different: The number of parameters is different.  The corresponding data type of the parameter is different. Next is the array, which is basically a bit like other languages, int[] Arr=new int[3]; about this new is about the memory allocation problem of Java, in Java is divided into five types of storage, stacks, used to store local variables , heap storage all new out; the method area; Method Area (System-dependent), register (CPU use), at present, we can not touch the back, only the first two, stack it is to store local variables, the data after the use of it disappeared. Heap new things are in the heap, every one of the new things have an address

if we define an int arr3[]=arr at this time, then ARR3 is the address of ARR, at which point the ARR3 points to the address space of arr in the heap.

Fourth day of Java learning

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.