J2se (1)-data basics

Source: Internet
Author: User

The content in this article comes from the j2se video of Jack Ma. The data foundation in Java is a computer language, which is similar to other programming languages. We know that if we call out the benefits, learning is easy.


(1) General diagram:


On the right side, the large to small inclusion relationship is: it will be clear at a glance.


(2) Details



The two pictures are one picture. If the previous picture is macro, the next picture is the details.


Identifiers, keywords, data types, expressions, element characters, statements, and methods are personally considered to be no different from other languages such as C.


New things learned here:


1. Pay attention to the location where the local variables and member variables are declared, and declare the referenced data type variables in the data type. I may not have much understanding about this in my previous studies, it is clear now.


2. What are the differences between character and string types? The difference is: the former uses single quotes, and the usage is used as a variable; the latter uses double quotes. The usage is used as a pointer and points to the first character.


3. recursion: As mentioned in the introduction to data structures, it is actually very simple. In a word, this method calls itself. For example:


public class Test{public static void main(String[] arg){System.out.println(method(<span style="font-family:KaiTi_GB2312;">4</span>));}public static int method(int n){if(n == 1)return 1;elsereturn n * method(n-1);}}

How can we understand this self-call?


It's clear!


(3) summary:


Remember: The format is more important than the algorithm!





J2se (1)-data basics

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.