Java foundations are data types, variables, operators, process controls, loops and functions, respectively.
I. The nature of data type data types: The data type is the length of memory space that is specified in memory, expressed in bits and bytes
Basic data type: 1 numeric: Integer (Byte,short,int,long) and floating-point (float,double)
2 character type (char)
3 Boolean type (Boolenan)
Reference data type: 1 classes (Class)
2 Interface (interface) there are no variables but constants, and the methods are all abstract.
3 Arrays (Array)
Two. Variables 1. Declaring the data type partition memory space space in the stack memory with the datatype name
If it is the basic data type, the size is saved
If it is a reference data type: Saves the memory address of the object
Naming memory spaces cannot use keywords
Uppercase and lowercase letters, underscores, numbers, dollar sign $, numbers cannot begin
The assignment polymorphism takes place in the assignment here the method of constructing the polymorphic
Member Variable polymorphism
Method polymorphism
Direct instantiation of Polymorphic
2. Classification of variables---Local variables (dependencies), member variables (association relationships), static variables
3. Variable call----static variable: class name. Static variable Name
----member Variable: Object name. Member Variable name
Three. Operator: operator divided into assignment operator, arithmetic operator, logical operator, relational/comparison operator, bitwise operator, ternary operator
Four. Control flow: If......else ... switch
Five. Three elements of cycle cycle: Start value, step length, termination condition
Loop is divided into a for loop while loop Do...while loop Berak loop continue loop
Six. Function 1---The purpose of the function is to reuse code
2---A code snippet with a name is called a function
3---Function declaration is a modifier list return value function name parameter list method body return value
4---Function call: function does not call not execute, and package runs result return function call at
5---Overloading of functions: function name is the same, parameter list is called function overload
Java Fundamentals of Java theory