Java taught

Java taught

What is Java : Java can be understood as a programming language or development tool.

Purpose: The ultimate purpose of Java is to write programs that run directly on the machine.

How Java works:

The Java source program is compiled into bytecode after being compiled by the compiler. The bytecode is interpreted and executed by the virtual machine. The virtual machine sends each bytecode to be executed to the interpreter, and the interpreter translates it into a machine on a specific machine. code and then run it on a specific machine.

Concepts of classes and objects:

A class is a feature master for a group of objects, and an object is an implementation of a class.

Features (classes) include: basic attributes (properties) and behaviors (methods).

Basic data types:

Numeric:

      Integer type: byte (-128-127), short (15th power), int (31st power), long (63th power)

Floating point type: float (38th power), double (308th power)

Character type: char

Boolean: boolean

Lifetime of a variable: The lifetime of a variable is within the scope defined by {}.

New variables are stored in the heap and have no uniqueness.

There will never be 2 identical string literals in the constant pool.

 

operator:

       Arithmetic operators: + - * /% ++ --

       Assignment operator: = += -= \= *= %=

       Comparison operators: >< <= >= == ! = The operands on the left and right sides can only be numbers

       Logical operator: Both sides of the operator must be   variables, constants, expressions of type boolean

with  &&  or  ||  NOT  !

with: as long as there is a false is false

Or: as long as there is one truth is true

Ternary operator: expression ?if-true-statement : if-false-statement

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325642766&siteId=291194637