Java Learning--chapter II, "Java syntax"

Source: Internet
Author: User
Tags arithmetic operators bitwise operators logical operators

Grammatical important points of knowledge

    1. 8 Basic data types: Byte,short,int, long,double, Float,char,boolean (1,2,4,8,4,8,2byte).
    2. The meaning of an explicit identifier, keyword, variable, constant.
    3. Operators: Assignment operators, arithmetic operators, comparison operators, logical operators, bitwise operators, ternary operators (?). :)。
    4. Type conversions.
    5. Code comments.

Process Control key points of knowledge

    1. Conditional statement (if statement, switch statement (can use shape, character, string))
    2. Loop statement (While,for,foreach)

Practice:

    1. Print a diamond with a for loop
 Public Static voidMain (string[] args)
{ for(inti=1;i<5;i++)//draw above 4 lines { for(intj=4;j>i;j--)//Draw Spaces{System.out.print (" "); } for(intk=1;k<=i*2-1;k++)//painting *{System.out.print ("*"); } System.out.println (); } for(inti=1;i<4;i++)//draw the following 3 lines { for(intj=i;j>0;j--)//Draw Spaces{System.out.print (" "); } for(intk=5;k>=i*2-1;k--)//painting *{System.out.print ("*"); } System.out.println (); } }

Java Learning--chapter II, "Java 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.