20165111 2017-2018-2 "Java programming" the second week study summary

Source: Internet
Author: User

20165111 2016-2017-2 "Java program design" the second week to summarize the learning content of learning materials

The content of this chapter will be compared with the C language study

Basic data types
  • The Java language uses the Unicode standard character set, which includes not only ASCII code, but also all the text in history. Therefore,the variable names in Java can use Chinese characters.
  • The keyword for a logical type is Boolean, and the constant is true,false instead of 0,1.
  • There is no unsigned number for the Java integer type, and there is no unsigned similar to C language.
  • The declaration of a single-precision floating-point (float) variable must have a suffix f/fafter the constant amount.
input and output data
  • Input

    Scanner reader = new Scanner(System.in);类型名 变量名 = reader.next变量名(首位大写)
  • Output

    System.out.print()或   不换行输出System.out.println()   换行输出

    Allows you to use the collocated symbol + to output a variable, an expression, or a constant value with a string.

Array
    • Statement

      int []a,b或int a[],b[];

      Note: Java does not allow brackets in the declaration array to specify the number of array elements, that is, do not allow

      int a[10]或int [10]a;
    • Distribution

      数组名 = new 数组元素的类型[数组元素的个数]

      Note: Java allows you to specify the number of elements of an array using the INT variable, which allows

      int size=10;double number[]=new double[size];
Problems in teaching materials learning and the solving process

In a few examples of textbooks, the main program begins

import java.util.*

You can refer to this blog for the relationship between import and package.

Problems in code debugging and the resolution process

For the above mentioned in the code containing the import package, compile and run the same as before with the package is now playing with special treatment, normal operation can be.

Code Hosting

20165111 2017-2018-2 "Java programming" the second week study summary

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.