Several things that must be learned by beginners in Java

Source: Internet
Author: User

I. Origin and Development of Java

It was initially named oak, and an important start-up for development was James Gosling (James Gaussian forest), which was designed for small systems such as household appliances.Programming LanguageTo control and communicate with household appliances such as televisions, telephones, alarm clocks, and toaster. Sun gave up the plan because the market demand for these Smart appliances was not as high as expected. Just as oak almost failed, with the development of the Internet, Sun saw the broad application prospects of oak on the computer network, so it transformed oak and was officially released under the name of "Java. Sun is now acquired by Oracle (Chinese name: Oracle). The latest JDK version is JDK 1.7.

2. Object-oriented Design Language

I believe that many beginners have seen a lot of books writing object-oriented design methods, but it is estimated that few beginners can understand what object-oriented design is. What are the advantages of this design method, as a student who has a deep understanding of object orientation, I want to express my ideas. I hope that beginners can understand them and experts can point out my mistakes.

 Object-oriented: When we think about the problem, we think about everything in the world as an object. This explanation may be hard to understand. Let's take a few examples: a person, we convert a logical person into an object in a computer. Likewise, animals, trees, and bulbs can all be used as objects.

The current Object-oriented thinking has been extended to many aspects, such as database systems, interactive interfaces, application structures, application platforms, distributed systems, network governance structures, CAD technology, artificial intelligence and other fields. In addition, it refers to the process of Object-Oriented Analysis (OOA), object-oriented design (OOD), and Object-Oriented Programming (OOP.

Java OOP has three major features: encapsulation, continuation, and polymorphism.

ClassKeywords: class the representation of objects in the computer. A class has the attributes and methods of objects, and class instantiation is the object.

Encapsulation: The attributes and methods of an object are all in a class. A feature that cannot exceed the class scope is called encapsulation.

Inheritance: Define a class using keywordsExtendsAll methods and attributes of the other class are called inheritance. Java inheritance specifies that a class can only inherit one class and cannot have multiple parent classes. In addition, it is worth noting that the subclass constructor in inheritance uses a statement: Super () by default in the constructor (); by default, this statement calls a constructor without parameters in the parent class. When the parent class has a constructor with parameters but no constructor has parameters, the compiler reports an error, if there is no constructor in the class, the non-argument constructor is automatically added.

Polymorphism:In terms of inheritance mechanism, the parent class has methods and attributes, and The subclass re-defines the methods and attributes. When it is called elsewhere, why is the type referenced, the method of the class is called. This is the object-oriented polymorphism.

Learning to be proficient in Object-Oriented Design Methods means learning to be proficient in Java. The above is just a supplement in books, which is easy for beginners to understand.

3. compile JavaProgramSoftware Tools

1. Eclipse

2. myeclipse

3. netbeans

Iv. JDK environment variable configuration in Windows

Click "computer"> "right-click" properties ">" advanced ">" environment variable ."

2. In "system variables", set three attributes: java_home, path, and classpath (case-insensitive). if it already exists, click "edit". If it does not exist, click "new ";

3. Set java_home to the JDK installation path (for example, c: \ Program Files \ Java \ jdk1.5.0 _ 11). This path includes Lib, bin, JRE and other folders (it is best to set this variable, because Tomcat and eclipse will all depend on this variable in the future );

Path allows the system to recognize Java commands in any path and set it to % java_home % \ bin.

Classpath is the path of the Java loading class (class or Lib). Only the class in classpath can be identified by Java commands and set :.; % java_home % \ Lib; % java_home % \ Lib (to be added. Indicates the current path) % java_home % refers to reference the previously specified java_home. Figure 1-1

4. Open a DOS window and enter "Java-version ".

Check that a lot of version information indicates that the configuration is successful. The configuration is successful. How can we use JDK?

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.