JAVA Fundamentals 1

The history of computer language development

1st Generation Language: Hole Punch

Second Generation Language: Assembly

The third generation language: c c++ c# (.net) java

Fourth generation language: sal (database)

The Father of JAVA: James Gosling

JAVA generation:

  The emergence of any thing has both inevitable reasons and accidental factors, and the emergence of the java language also verifies this. Java comes from a project called Green by Sun, whose original purpose was to develop a distributed code system for household consumer electronic products, so that we can send E-mails to household appliances such as refrigerators and TVs, and perform operations on them. control and communicate with them. Begin to prepare to use C++, but C++ is too complicated and has poor security. Finally, a new language Oak (the predecessor of Java) is developed based on C++. Oak is a sophisticated and secure language for networking. Sun has bid for a Interactive TV project, but the Oak language was not a commercial success.

  Turning to 1995, the Internet was booming in the world. Sun found that the cross-platform, object-oriented, and high security features of the Oak language were very suitable for the needs of the Internet, so they improved the design of the language to achieve the following: Target:

1. Create an object-oriented programming language, not a procedural language;

2. Provide a program operating environment for interpretation and execution, and the program code is independent of the platform;

3. Absorb the advantages of C and C++, making it easy for programmers to master;

4. Remove the parts of C and C++ that affect the robustness of the program to make the program more secure, such as pointers, memory allocation and release;

5. Implement multi-threading, so that the program can perform multiple tasks at the same time;

6. Provide a mechanism for dynamically downloading program code;

7. Provide a code verification mechanism to ensure security; in 
  the end, Sun named the language the java language, creating a generation of successful programming languages. There are also some interesting anecdotes about the name of Java. One day, several members of the Java member group were discussing what name to call this new language. At that time, they were drinking Java (Java) coffee in a coffee shop, and one person had an idea and called it Java. How, it was appreciated by others, so the name Java spread like this.

2. Overview of JAVA

1. The three directions of
    JAVA Java is a programming language used to write software. Common software such as QQ, Thunder, Taobao, Jingdong, etc. can be written in Java.
In fact, Java is best at writing the following types of software:
Internet: e-commerce, P2P
enterprise-level applications: ERP, CRM, BOS, OA
JavaSE is the standard version in the java classification, and it is the basic knowledge to learn when you are new to java.
JavaEE is the enterprise version in the java classification, is the advanced level in java, and involves a wide range of knowledge.
M in JavaME is the abbreviation of Micro, which is used in embedded electronic devices.

2. JAVA features: concise, high security, cross-platform (write once, run everywhere)

3. JAVA is a pure object-oriented language (encapsulation, inheritance, polymorphism)

3. Preparation:

1. EditPlus software: a text editor, which is easier to use than the notepad that comes with win.

2. Operating environment: JAVA operating environment.

3.eclipse software: JAVA editing software.

4. Introduction to JAVA:

1. Keywords

public: public;

class: class;

2. Identifier: Anything you need to name yourself is called an identifier.

3. Coding specification:

  • It is strictly forbidden to start with a number; it can start with a letter, underscore, $
  • Follow the camel case input method: the first word is lowercase, and the first letter of each subsequent word is uppercase; for example: getElementById()
  • Class names must be capitalized

5. Data types (you must learn each subject first)

JAVA data types are mainly divided into four categories and eight types:

(bytes: the space on the computer occupied by data storage)

1. Integer: byte occupies 1 byte, the value range is 2 to the 8th power, that is, from -128 to 127;

    short occupies 2 bytes, and the value range is 2 to the 16th power;

    int occupies 4 bytes and takes the value range of 2 to the 32nd power, generally using int is enough;

    long occupies 8 bytes and ranges from 2 to the 64th power;

2. Floating point type: float single-precision floating point type, occupying 4 bytes, the value range is 7 digits before and after the decimal point;

     double Double-precision floating-point type occupies 8 bytes, and the value range is 11 digits before and after the decimal point;

3. Boolean: boolean occupies 1 byte and has only 2 true and false values;

4. Character type: char is represented by single quotation marks ' ', occupying 2 bytes;

There is another one: the string String is represented by double quotation marks '' ''; it is widely used and has a high frequency but does not belong to the basic data type ;

Other notes:

1. Type coercion: characters and integer variables can be converted to each other;

2; The characters in JAVA can be operated, because the variable of the character type represents the index of the character in the Unicode encoding table, for example, the conversion of a to an integer is 97, and the conversion of 105 to a character is 107;

 

Guess you like

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