Chapter 1th Java Overview

Source: Internet
Author: User
Tags class definition

1.1 Java language History and Platform 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.4 sparkler Gem 1997-09-12
    • JDK 1.1.5 Pumpkin Pumpkin 1997-12-13
    • JDK 1.1.6 Abigail Abigail--Women's name 1998-04-24
    • JDK 1.1.7 Brutus Brutus--Roman statesman and general 1998-09-28
    • JDK 1.1.8 Chelsea Chelsea-city name 1999-04-08
    • J2SE 1.2 Playground Sports Ground 1998-12-04
    • J2se 1.2.1 None None 1999-03-30
    • J2SE 1.2.2 Cricket Cricket 1999-07-08
    • J2SE 1.3 Kestrel Americas Red Falcon (SǓN) 2000-05-08
    • J2SE 1.3.1 Ladybird Ladybug 2001-05-17
    • J2SE 1.4.0 Merlin Grey back Falcon 2002-02-13
    • J2SE 1.4.1 Grasshopper Grasshopper 2002-09-16
    • J2SE 1.4.2 Mantis 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

      1.2 JVM,JRE,JDK Overview 1.2.1 What is cross-platform?
      Platform: Refers to the operating system (WINDOWS,LINUX,MAC)
      Cross-platform: Java programs can run on any operating system, write once and run everywhere
      Principle: Implementing a virtual machine JVM that relies on Java for cross-platform use (Java virtual machines)

1.2.2 JVM JRE JDK Description
A: What is a JVM
The JVM is a Java Virtual machine (JVM java VM), Java programs need to run on virtual machines, different platforms have their own virtual machines, so the Java language can cross-platform
B: What is the JRE
Includes the Java Virtual machine (JVM Java) and the core class libraries required by the Java program, etc. if you want to run a well-developed Java program, you only need to install the JRE on your computer.
jre:jvm+ class Library.
C: What is a JDK
The JDK is available to Java developers, which includes Java development tools and the JRE. So with the JDK installed, you don't have to install the JRE separately.
Development tools: Compilation Tools (Javac.exe) packaging Tools (Jar.exe), etc.
Development tools for Jdk:jre+java.
D: Why the JDK contains a JRE
Why does the JDK include a JRE?
After the development of the program, you need to run a look at the effect.
The role and relationship of E:JDK,JRE,JVM
JDK contains JRE and development kit
JRE contains core class libraries and JVMs
1.3 Common DOS Commands 1.3.1 Open the console
–win + R, then cmd enter
1.3.2 Common Commands
–d: Enter drive letter Toggle
–dir (directory): List files and folders in the current directory
–CD (change directory) changes the specified directory (enter the specified directory)
? Go to CD directory, CD multi-level directory
? Fallback CD: ; cd\
–CLS: (Clear screen) clear
–exit: Exit DOS command line
1.4 Downloading and installing the JDK
Please refer to the JDK download installation documentation. DOC installation Steps
1.5 HelloWorld case 1.5.1 Execution Process

1.5.2 Writing code steps
First define a class
public class class name
Add a pair of curly braces after the class definition
{}
Add a main (main) method/function to the middle of the curly braces
public static void Main (String [] args) {}
Add a row of output statements to the middle of the main method's curly braces
System.out.println ("HelloWorld");
1.5.3 Case Code One

public class HelloWorld {public static void main(String[] args) {System.out.println("HelloWorld");}}

To run the code step:
? In the command line mode, enter the Javac command to compile the source code and generate the bytecode file
–javac source file name. java
? After compiling, if there is no error message, enter the Java command to interpret the class bytecode file and do not need to add the. class extension
–java HelloWorld
1.5.4 HelloWorld Case FAQs
A: File not Found
A: File name extension shadowing causes compilation to fail
B: The file name is wrong
B: Word spelling problems
A:class written as Class
B:string writes string
C:system written system
D:main written Mian
C: Bracket Matching problem
A: Remove the curly braces from the class body
B: Remove the curly brace from the method body
C: Cut out the curly brace of the output statement.
D: Chinese and English issues
A: Message: Error: illegal character: \???? The format
Note: English characters are basically required in Java programming

Chapter 1th Java Overview

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.