"Java" basic syntax

Source: Internet
Author: User

While Java is a new programming language, the basic syntax is the same as the programming language you learned before.Since it is called the grammar, there must be some rules. Among them, inIdentifiers and Keywordssection, we can clearly see some of the mandatory requirements.keyword cannot be used as an identifier,The identifier is a lowercase letterAnd so, this has a series of rules, but we do not need to remember, according to the conventional walk, combined with their own experience of the past, there is no problem.Learning the programming language for so long, but also summed up a lot of data on the point of knowledge. And this time, one layer after another, the relationship between them is more closely connected.Datais indispensable in the program. And how do we get the data or enter the data? This requires ourConstants and Variables, they help us to store data temporarily so that we can easily access and enter it.And the storage of data is not haphazard, and we need to base theirtypeSelect the corresponding type to declare. For example, int only represents an integer type, and Boolean only represents true or false.During the programming process, you will also encounter many situations where you need to change the data type. At this time, we can go throughData ConversionTo achieve. Also, there are certain rules that must be observed, such as the Boolean value does not allow conversion, small capacity numeric type and large capacity of the numeric conversion can be without coercion, it will be automatically implemented, otherwise there will be various overflow problems.I do not know if you remember the teacher once said that "anything in the world can be achieved with three control statements, namely, order, selection and circulation."Every time you learn or see these three categoriesStatement, the first thing to think of is this sentence. Today's study, as before, there is no new things, just in the programming language format may be somewhat different.It is most important for any program to be written with clear logic and clear thinking. Perhaps, there is no guarantee that each time is to write an implementation of one, but after their own constant debugging, and eventually will certainly get the desired results.arithmetic, has been in contact with. Only in the computer language, it is broader, more powerful, for what relational, logical one by one can be achieved. Take some kind of, we know how to calculate the good.The last part of the method is also very familiar. What isMethod? When will you think of the method?Very simply, in connection with these two years of study, oneself is in want to complete a function of time will write method. So, the method is to help us to achieve a variety of functions of the tool.And through the computer room fee system and the study of soft workers, their understanding of the method level is a step-by-step upgrade. Before contacting with the EA to draw, each method has several essential things:1. Parameters, which include both the actual parameter and the formal parameter class2. Return value3. Return typeAnd the one-by-one method of the lonely, inevitably feel very troublesome, monotonous. So it's possible to do it between methodscalled。In Java, the return statement refers to the termination of the program, which is not the same as before.In summary, the basic Java syntax is also the five parts, and before learning VB, C + + when the time is not much difference, the equivalent of re-review reviewed again.Theory is necessary, believe that the practice of the back will be more delicious ~

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Java" basic syntax

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.