Summary of the 2nd week of Java programming

Source: Internet
Author: User

(a) The basic types in Java are mainly divided into: integers, bytes, floating-point numbers, characters, Booleans. Integers: Short (2 bytes), int (4 bytes), Long (8 bytes) Bytes: Byte (integer that can represent -128~127) floating-point number: Float (4 bytes), double (8 bytes) Character: Char Boolean (Boolean): can be expressed as true and false.

(b) Because of the previous study of C, so the common format control symbols in Java is not unfamiliar, here do not enumerate.

(c) Variable: Declaring a variable in a method is called a local variable, but if you do not assign any value to it, the use error occurs, and you do not want to change after the specified variable to add the final qualification to the declaration variable. (basic rule) integers can be in binary (0BDDDD), octal (0DDD), Decimal (dddd), hexadecimal (0Xdddd).

(d) Operators: (arithmetic operations) + 、-、 *,/,%, (relational operations)!=>, >=, <, <=, = = (conditional expressions)? return value at set-up: return value on Failure, (logical operation) with (&&), or (| | ), Non-(! ), (Bitwise operations) & (and), | (OR), ^ (not), ~ (XOR) (shift left) << (shift right) >>

(v) Type conversion: When an expression includes two or more types of numeric values, the operation is performed with the longest length type as the standard.

(vi) Process Control: Branch type statements include if, If...else, If...else If, switch...case, switch, which can be used for integers, characters, strings, and so on. However, the conditions of the default branch require that the principle of non-repetition and not omission be satisfied. The loop type statement includes for, while, Do...while, Break/continue, and its label can be similar to the effect of the C inside Goto, but the book is not recommended for use.

Problems in teaching materials learning and the solving process

This study felt a lot like C inside the knowledge points, including usage, and so on, the main small problems need to pay more attention to, for example, when defining the variable is not aware of the value of the assignment beyond the scope of the variable.

Problems in code debugging and the resolution process

It's mostly about knocking down the code that you haven't tried in your book.

Use left shift to do 2 squared calculations.

99 Multiplication Table

Other (sentiment, thinking, etc., optional)

Java and C still have a lot of similarities, the teacher said is very right, as long as the number of knock on the code, after the fear period, slow down a good. The process of learning still needs a lot of summing up methods and ask why.

Learning progress Bar

Summary of the 2nd week of Java programming

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.