Java Understanding Program Logic

Source: Internet
Author: User

A variable is a representation of a data storage space, which is the basic unit for storing data.

The data types commonly used in Java are integers (int), double-precision floating-point (double), character (char), and string-type (string).

Variables must be declared and assigned first, as follows.

  1. Assignment operator (=)
  2. Arithmetic operators (+,-, *,/,%).
  3. The relational operator (<,>=,>,<=,==,!=).

Data type conversions are designed to facilitate operations between different types of data.

Data type conversions include automatic type conversions and forced type conversions, which must meet certain conditions when automatic type conversions occur.

Boolean is used in Java to represent true and false, and two values of Boolean type are real and false.

The use of relational operators in Java can be used to compare sizes. High and low. The result after comparison is the Boolean type.

Java provides the scanner class to get the information entered on the keyboard from the console.

Java Understanding Program Logic

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.