Learning JAVA Programming Practice tutorial

Source: Internet
Author: User

I always wanted to learn Java because of curiosity and free. But because it is not used at work, and it is too high in hardware configuration, it is only occasionally used to learn. I have found tutorials and articles on the Internet, but I have not learned anything. I also bought more than 700 pages of Java j2se 5 edition reference book, because it is too thick to read. Finally, I bought a "Java programming practice tutorial" published by Tsinghua University Press. The book is not thick (400 pages), and it is not difficult, just suitable for basic learning. After reading the two chapters, I know that there are actually a lot of things to pay attention to. The following is a summary.

Chapter 1

This chapter is an overview of Java and mainly describes the history, features, and development tools of Java. One thing to note here is the setting of environment variables during JDK installation. Although it has been set many times, it has not been confirmed until now that the computer needs to be restarted to set environment variables in Win98, win2000 and later do not need to restart the computer, but the command prompt opened before setting is still the environment variable before modification. You can directly enter the environment variable name to display the Setting Value and determine whether the setting is correct. In addition, when compiling and running a Java program, it is usually switched to the directory where the source program is located, so that every source program directory does not need to be added in the class_path environment variable, just add a ". "(representing the current directory). Another method is to temporarily set the class_path environment variable and use set class_path = ".; d:/jdk1.5/lib "command.

Chapter 2

1. constants: The book is divided into a literal value (constant) and an identifier constant, which is not easy to understand. However, in practice, it is found that the so-called constants do not actually know how to define them, and there is no difference with the definition of variables, but with final, there is only one assignment opportunity, or initialization during definition, either assign a value after the definition (or only once). In fact, you can also use the final keyword in the definition of classes and members, but the meaning is different. Constants are defined as uppercase letters. You can use an expression composed of other constants when defining constants.

2. variables: Use the camal naming rules. The first word is in lowercase, and the last word is in uppercase. Variables of the same type can be defined in the same sentence, and variables can be initialized at the time of definition, constants can be used at the time of initialization, or they can be used effectively (please note that this is effective, the expression that can determine the value must be calculated before the variable is defined. The most obvious difference is that it cannot contain non-initialized variables. If a function is included, it must be static .) .

3. Java is a strongly typed language. Using uninitialized variables will cause an error. No data type is specified during the value assignment (for example, float f = 2.0, float F = 2.0f) it will also cause errors. In addition, the system is used to output formatted numbers or strings on the console. the printf or format method of out, instead of the print and println methods. The differences between the several letters are found in my last 30 days (! #_#!).

4. At the end of this chapter, the escape characters, operators, and their priorities are basically consistent with those of other languages. However, several keywords are also divided into operators, including instanceof (instance operator), new (internal allocation operator), T. setpriority (component operator), and forced type conversion operator.

Chapter 3

 

<Continue learning...>

Related Article

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.