Java Learning Diary: WEEK1---day1-2 java primary knowledge

Source: Internet
Author: User
Tags java se

Objective:

The new journey officially began, after a two-week C-language preparatory class to learn, the development of the program has a first step of understanding. Now the Java curriculum also started as scheduled, for a programmer is to learn which language good has no need to explore, now that the Java ship naturally to go honestly, to what extent you see yourself, the individual is still a bit of confidence in himself.

Class from yesterday formally began, yesterday, the teacher told a big aspect of things, in short, no specific content, today began the initial Java first lesson; simple rationale for what the teacher said today, picked some key points in the diary.

One, Java version and JDK

  1) Several versions of Java

Java SE (J2SE): Java to Standards Edition Standard Edition positioning on PC applications

Java EE: Java to Enterprise Edition in server-side applications

Java ME (J2ME): Java to Micro Edition miniature version positioning in Consumer electronics applications

  2) JDK

JDK is divided into 3 parts: JVM, JRE, JDK;

The core part of Jvm:java virtual machine VM Java is used to interpret the compiled source code file (. class file) for CPU execution; the existence of a Java Virtual machine makes Java a cross-platform feature. Java source code files only need to be compiled once to generate the class file, it can be installed on the various operating systems of the virtual machine execution;

The Jre:java Runtime Environment runtime environment contains Java Virtual machine (JVM), library functions, required files to run Java applications and applets, and programs written by Java can run under a computer with a JRE installed;

The Jdk:java Development Kit Development Kit includes the debug and compile tools used by the JRE and the developer.

              

II. Preparation of Java development (developed under Windows)

1) Install the JDK;

2) Configure environment variables:
1. Right-click My Computer-Properties-Advanced settings-advanced-environment variables

2.

      

Iii. preparation of the first procedure Hello World

 Public class Test/*(test is the class name (class identifier), class stands for classes, public class stands for common classes, and the file save name must be the same as the public class's flag and + suffix. java)*/{     Public Static void Main (string[]  args)   {    System.out.println ("hello\tworld!"); // print and wrap, \ t indicates tab stops are indented backwards    System.out.print ("Hello World again\t\n!"); // prints but does not wrap, \ n = line break    System.out.print ("Hello World again!" );  }}

To execute a program in the console:

1. Compile the source program--Generate a byte-code file (. Class)

Open the DOS window (win+r-àcmd) After configuring the environment variable---à will be in the same directory as the source file (CD command)--javac Test.java

2. Execute the bytecode file

A. class file is generated after the source program compiles

Executing Java Test in a DOS window

The. class file is executed at the console via Java.exe.

The results of the implementation are as follows:

  

Write so much first, and then make some additions to the weekend.

Java Learning Diary: WEEK1---day1-2 java primary knowledge

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.