1th Java Introductory Experience

Source: Internet
Author: User

1th Java Introductory Experience 1.java introduction and Platform Application

Java was developed by Sun and now belongs to Oracle.
Java is divided into several parts:
The first is the most basic Java SE part, which is the basic knowledge of Java, mainly includes: variables, syntax, object-oriented, API,JVM, etc.
The Java SE Foundation is divided into two parts. One is the development of enterprise-class services, one is the development of embedded
Java EE is enterprise-level development, including: JSP, EJB, service and so on.
Java me is embedded in the development, mainly mobile devices, games, communications, etc.
Beginner's basic line is starting from the Java SE, first learn the basics, then learn the direction, I will learn the Java SE Part after the Java EE part of the study

2. Core concepts: JVM, JDK, JRE2.1.JVM (Java Virtual machine)

Java Virtual machine, is the way to upgrade Java technology, for the JVM only research and research, no other way
Working principle:
Run (MyProgram), byte-code file (myprogram.class file), source file (Myprogram.java file)
Source files to bytecode files are passed through the compiler, bytecode files to run through the interpreter
To give an example:
We went to the market to buy a fish back, to make a delicious dish of the process:
The process is divided into two steps:
1. Live fish to kill wash clean, the fish to be able to cook the degree of cooking, this step is the role of the compiler, the translation of documents into the machine can perform the process
2. Cook the fish in a halal, the process is to make the fish delicious, this step is the role of the interpreter, the processing of the processed files into a useful program.

2.2JDK (Java Development Kit) Java Development Kit

This package is to be developed when you have to install, generally only install this can be

2.3JRE (Java Runtime Environment) Java Runtime Environment

If you want to run a Java program, this must be installed

The relationship between the above three can be illustrated by a diagram:

3. Build the Java Development environment

Windows as an example:

3.1 First step: Download and install JDK3.2 Step Two: Configure environment variables

The environment variables here need to be configured with three:
Java_home: Configuring the JDK installation path, example JDK1.7
PATH: Configure the location of the JDK executable command file, example bin directory
CLASSPATH: Configuring the location of the class library file, example Lib directory
Configuration method, configured on the computer environment variable

Terminal command input Java and JAVAC can see the use of methods, indicating the success of the configuration

4. Using tools to develop Java programs 4.1 Use Notepad to write Java programs

1. Create a Helloword.java file
2. Create a Helloword class in the file, note that the name of this class is exactly the same as the file name of your file, and the case must be the same.
3. The code example is as follows

1  Public  class helloworld{2      Public  Static void Main (string[] args) {3         System.out.println ("Hello word!" ); 4     }5 }

4. Compile the file using the Javac Helloworld.java command to get a helloworld.class compiled file
5. Run the. class file using the Java HELLOWRD Command, note that this is a. class file that is not suffixed, and the result is available: Hello word!

4.2 Integrated development environment

Here I am using idea, the steps are almost the same:
1. Create a Java project, file->projects
2. Create a package, put different files under different packages, so that there is no duplicate problem, SRC create a new package
3. Write Java source code, the package is written in different classes
4. Running Java programs

4.3 Porting of programs

How do I export my project to another computer to continue development?
1. Locate the file path and copy it out
2. Import on another computer

5. Experience and skill sharing

1. More practice, Java must be more practice, the enterprise requires a strong hands-on ability
2. Ask more, not how bad, ask more
3. Do it yourself, debug errors
4. Often review and summarize, mainly Java is too much knowledge points, to more summary

1th Java Introductory Experience

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.