Java SE Knowledge Point Summary

Source: Internet
Author: User
Tags bitwise operators float double mathematical functions java se

A: Java Basic program Design structure:

1.1 data types

   in Java, there are 8 types of data, including 4 integers, 2 floating-point types, 1 character types (char), and 1 Boolean types.

Integral type: int short long byte

Floating-point type: float double (double is twice times the dual precision of float)

Character type: char (used to represent a single character)

Boolean type: True and False (used to determine the logical condition, cannot be converted between an integer value and a Boolean value)

1.2 variables

when a variable is initialized, after declaring a variable, the variable must be displayed initialized with an assignment statement, never using a variable that is not initialized.

The declaration of a variable is as close as possible to the place where the variable was first used, which is a good programming habit.

If the constant is modified by the keyword final, it will not be able to be changed once the value is assigned. You can use the keyword static final to set a class constant, which is typically outside the class.

1.3 operator

in Java, you can also use the arithmetic operator +,-,*,/operation.

The increment operator and the decrement operator (such as n++ self-add 1,n--1).

Relational operators and Boolean operators: use two = = to detect equality! = detection is not equal.

bitwise operators: When working with integer values, you can directly manipulate the number of bits that make up an integral type.

Mathematical Functions and constants

Java SE Knowledge Point 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.