Java Fundamentals of Java theory

Source: Internet
Author: User

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

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.