20145239 Du Wenshu "Java Programming" 2nd Week study Summary

Source: Internet
Author: User

20145239 "Java Program design" The 2nd week study Summary textbook Learning content Summary

The third chapter mainly introduces the basic syntax of Java language.

We are asked to recognize types and variables, to learn the basic use of operators, to understand type conversions, and to apply basic process syntax. of which--

One, constant basic type: integer: Short integer (2 bytes), int integer (4 bytes), Long Integer (8 bytes) byte: Byte type (1 bytes, generally used for byte-by-bit processing) floating point number: float floating point number (4 bytes), Double floating point number (8 bytes) Character: char type (2 bytes) Boolean: Boolean, which represents true and false, respectively, representing the true and false of the logic.
Second, variable: to store the indeterminate data.
operator : arithmetic operator: plus (+), minus (-), multiply (*), divide (/), modulo operator (%) comparison operator: greater than (), less than ((), not greater than (<=), not less than (>=), equals (= =), not equal to (!). =). Logical operations: And, or, not, && (and), | | (OR),! (not). (| /& operations on both sides, | | /&& Left is false, right does not operate. )
Iv. Process Control: Judging structure: if-else statement. Select structure: switch statement. Loop structure: The while statement, do while statement, for statement. Other statements: break,continue statements, and so on.
Problems in teaching materials learning and the solving process

(a) Do not know the range of values can be stored in various types, want to know through the API, according to the code running on the book to see the results.

 Public classRange { Public Static voidMain (string[] args) {//byte, short, int, long rangeSystem.out.printf ("%d~%d%n", Byte.min_value,byte.max_value); System.out.printf ("%d~%d%n", Short.min_value,short.max_value); System.out.printf ("%d~%d%n", Integer.min_value,integer.max_value); System.out.printf ("%d~%d%n", Long.min_value,long.max_value); //float, double precision rangeSystem.out.printf ("%d~%d%n", float.min_exponent,float.max_exponent); System.out.printf ("%d~%d%n", double.min_exponent,double.max_exponent); //The Unicode range that char can representSystem.out.printf ("%h~%h%n", Character.min_value,character.max_value); //two values for BooleanSystem.out.printf ("%b~%b%n", Boolean.true,boolean.false);}}

(b) The previous thought that the Java println and C in the printf may be the same meaning is only different, but in fact, there are a lot of differences, according to check the data and their own experiment to know:

PRINTLN is used to output the contents of a parameter, and then wraps, with a fixed number of arguments.
printf is a parameter that is used to output placeholders with various data types, with a variable number of arguments. and printf cannot wrap, you must add "\ n" to line.

Problems in code debugging and the resolution process

When you run the following code:

The only way to find break is to jump out of the current loop, which is the inner loop, but this is a nested for loop, how can you use break to jump out of any specified loop?

Later, according to the video I learned a new syntax, is to give the loop tag, namely:

In this way, you can use the break statement to jump out of any loop, which I have not used in the C language learning a little trick.

I also have a deeper understanding of the difference between break and continue, but it is important to note the use of break and continue.

Also, when the break and continue statements exist separately, the following can be a statement, because they do not.

Other (sentiment, thinking, etc., optional)

I thought the Java language and C language could be very different, because one is a process oriented, one is object-oriented, but after this week's study I find that the two are so similar in syntax. Because the grammar of the C language mastered the basic clearance, so I feel that this week's learning task is not very difficult, I am very gratified at the same time also inspired me to study in the back of curiosity and enthusiasm, what makes them into two completely different languages? But there is a saying: The details determine success or failure. Java syntax in a lot of detail is still different from the C language, this kind of process is actually a good way to learn. All learning begins with imitation, from imitation to proficiency, to improvement and innovation. I hope that I can continue to inspire the enthusiasm of learning Java and keep learning momentum.

Learning progress Bar /Cumulative) new/cumulative)
lines of code (newBlog volume (Learning time (new/cumulative) Important growth
Goal 5000 rows 30 Articles 400 hours
First week 100/100 1/2 15/15
Second week 200/300 1/3 12/15
Resources
    • Java Learning Notes (8th Edition)
    • Java Learning Note (8th Edition) Learning Guide

20145239 Du Wenshu Java Programming 2nd week of study summary

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.