Java Basics (i)

Source: Internet
Author: User

Java language Overview The history of A:java language   

James Goslin James Gosling received a BS in computer Science from the University of Calgary in Canada in 1977, a PhD in computer science from Carnegie Mellon University in 1983, and worked at IBM after graduating to design IBM's first generation workstation news system, but it was not appreciated. Later transferred to Sun, 1990, and Patrick,naughton and Mike Sheridan and other people to cooperate "Green plan", later developed a set of languages called "Oak", then renamed Java.
SUN (Stanford University Network, Stanford University Internet company)

  B:java language version 

* JDK 1.1.4Sparkler Gem 1997-09-12
* JDK 1.1.5Pumpkin Pumpkin 1997-12-13
* JDK 1.1.6Abigail Abigail--Women's name 1998-04-24
* JDK 1.1.7Brutus Brutus--Roman statesman and general 1998-09-28
* JDK 1.1.8Chelsea Chelsea-city name 1999-04-08
* J2SE 1.2Playground Stadium 1998-12-04
* J2SE 1.2.1none No 1999-03-30
* J2SE 1.2.2Cricket Cricket 1999-07-08
* J2SE 1.3Kestrel American Red Falcon (SǓN) 2000-05-08
* J2SE 1.3.1Ladybird Ladybug 2001-05-17
* J2SE 1.4.0Merlin Grey back Falcon 2002-02-13
* J2SE 1.4.1grasshopper Grasshopper 2002-09-16
* J2SE 1.4.2Mantis Mantis 2003-06-26
* Javase 5.0 (1.5.0) Tiger Tigers
* Javase 5.1 (1.5.1) Dragonfly Dragonfly
* Javase 6.0 (1.6.0) Mustang Mustang
* Javase 7.0 (1.7.0) Dolphin Dolphin


  C:java Language Platform

  J2SE (Java 2 Platform standard Edition) edition
is a solution for developing common desktop and business applications, which is the basis for a number of other desktop applications to be developed
  J2ME (Java 2 Platform micro Edition) Mini version
is a solution for developing electronic consumer products and embedded devices
*ee (Java 2 Platform Enterprise Edition) Corporate Edition
* is a set of solutions for applications in developing enterprise environments, including technologies such as Servlets, JSPs, etc., primarily for web application development


D : Java language features

* Simple Nature
* Explanatory nature
* Object Oriented
* High Performance
* Distributed processing
* Multithreading
* Robustness
* Dynamic
* Structural neutrality
* Security
* Open Source
* Cross-platform

The principle of the Java language cross-platform

Just install a Java Virtual machine (JVM Java VM) on the operating system that needs to run the Java application. The JVM is responsible for the operation of the Java program in the system.

Write once, run anywhere! (one compile, run everywhere)

Overview of JRE and JDK

  What is a JRE

* Including Java virtual machines (JVM Java) and Java programs required by the core class library, if you want to run a well-developed Java program, the computer only need to install the JRE.
* jre:jvm+ class Library.

  What is a JDK
* JDK is available to Java developers and includes Java development tools and JRE. So with the JDK installed, you don't have to install the JRE separately.
* Development tools: Compiler tool (Javac.exe) packaging Tool (Jar.exe), etc.
* Development tools for Jdk:jre+java.

  Why the JDK contains a JRE

* After the development of the program, you need to run a look at the effect.

Download and install the JDK

: Official website http://www.oracle.com

Fool-Type Installation

Verify that the installation is successful
A: Through the DOS command, switch to the JDK installation bin directory.

B: Then enter Javac and Java separately, if some content is displayed correctly, the installation is successful.

Directory interpretation under the JDK installation path

  

* Bin directory : This directory is used to store some executable programs.
* such as Javac.exe (Java compiler), Java.exe (Java Runtime Tool), Jar.exe (Packaging tool) and * Javadoc.exe (document Generation tool), etc.
* DB directory : DB directory is a small database.
* Starting with JDK 6.0, a new member javadb is referenced in Java, a pure Java implementation, open source database management system. This database is not only lightweight, but also supports all JDBC 4.0 specifications, when learning jdbc, no more need to install a database software, choose to use JAVADB directly.
* JRE directory : "JRE" is the abbreviation for Java Runtime environment, meaning Java Program Runtime environment. This directory is the root of the Java Runtime Environment, which includes Java virtual machines, runtime class packages, Java application initiators, and a bin directory, but does not include development tools in the development environment.
*:include directory : Because the JDK is implemented through C and C + +, you need to introduce some C-language header files at startup, which is used to store these header files.
* Lib directory : Lib is the abbreviation for the library, meaning the Java class library or library file, which is the archive package file used by the development tool.
* src.zip file : Src.zip is a compressed file for the SRC folder, and the source code of the JDK core class is placed in SRC, which allows you to view the source code of the Java base class.

Introduction to Java Development tools

* A:NOTEPAD (Microsoft OS comes with)
* b:editplus/notepad++
* C:eclipse
* D:myeclipse

HelloWorld the writing and running of the case

Environmental configuration See (http://www.cnblogs.com/hudj/p/7461135.html)

New Java File

class HelloWorld {            publicstaticvoid  main (string[] args) {                System.out.println ("HelloWorld");            }        }

Compile

  

Generate class file

  

Run the class file

  

The difference between path and classpath

* path is configured with executable file. exe, which can be configured to access executable files under Path paths under different drive characters
* CLASSPATH configuration Java class file, which is the. class file

Comments Overview

The role of annotations
* A: Explanation procedure
* B: Help us Debug errors

Three different modes

/**    * Document Comments   */ class  HelloWorld            {publicstatic  void  Main (string[] args) {                System.out.println (// single-line comment /                         *    int a = 1;                  int b = 2;   Paragraph comment */              }        }            

Overview and use of keywords

 What is a keyword     

* Words that are given a specific meaning by the Java language

Features of the keyword    

* The letters that make up the keywords are all lowercase

  Common keywords     

* public static void class, etc.

  Keyword considerations     

* Goto and Const exist as reserved words, not currently used, advanced Notepad like EditPlus, with special color tag for keywords, very intuitive

Overview and composition rules for identifiers What is an identifier     

* is a sequence of characters to use when naming classes, interfaces, methods, variables, etc.

composition rules for identifiers

* English uppercase and lowercase letters
* Numeric characters
* $ and _

identifier Considerations

* 1, cannot use keyword
* 2, cannot start with a number

Naming conventions that are common in identifiers

 * See the meaning of the name
 * A: Package
* Preferably the domain name upside down, requires all the letters lowercase
 * B: Class or interface
* If the first letter of a word is capitalized
* If it is more than one word, capitalize each word first (hump mark)
 * C: Method or Variable
* If it is a word all lowercase
* If multiple words, capitalize from the first letter of the second word
  * D: constant
* If it is a word, all letters capitalized
* If there are multiple words, all the words are capitalized, each word is distinguished by an underscore

Java Basics (i)

Related Article

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.