Java language Basics

Source: Internet
Author: User

1. Introduction to Linux

1) file system

2) Current working directory, which is the default folder currently in use

folder = Directory

PWD print (show) Current working directory

3) User home directory, which is the personal directory of the currently logged in user

Personal home Directory, users have full administrative rights to their own user home directory.

4) mkdir Create folder

mkdir Demo Create folder in current folder (working directory) demo

5) CD switch (change) Current working directory

.. Represents the upper directory, CD. Switch to upper-level directory

. Represents the current directory

CD-Specified directory

CD/To-Follow directory

Cd/home/liucs to home directory

The CD command returns to the user home directory by default

6) LS display folder contents

7) Absolute path and relative path

A to follow (root) "/" to start the path is absolute path

B does not start with "/" relative path, relative path defaults to current directory

8) rm-rf dir Delete directory

9) Start eclipse

Cd/opt/eclipse

./eclipse

2. Introduction to Java

1) Java features: Simple, object-oriented, cross-platform, secure, multi-threaded support

2) Cross-platform for Java

Java implements cross-platform technology through the JVM

Java source Code (*.JAVA) is compiled by the Java compiler into

Java bytecode (*.class), executes Java bytecode, Java bytecode is interpreted by the JVM as specific instructions for a specific platform,

and execute.

Different platforms have different JVMs, and the main platform provides the JVM. So the Java bytecode can be interpreted on all platforms

Perform.

In this sense, Java is cross-platform. That is to say: Java bytecode is cross-platform.

3) Java JDK

JDK Java Development Kit/OPT/JDK or/opt/jdk_1.6.01

|--Bin development tool (command: Java,javac,jar,javad,jar,rmic,jps ...)

|--JRE JRE Java Runtime Environment

|--Lib (rt.jar) Java API (Application programming interface, System Class library)

| (Off-the-shelf components provided by Java)

|--bin (JAVA_VM) JVM Java Virtual machine

3. Java APP

1) Helloworld.java

Package basic.day01;

/** * Eclispe automatically compiles the current file to:

* Workspace/jsd1105/bin/basic/day01/helloworld.class

* (Workspace/Project/bin/Package Folder/class file)

* Execute this type of file when executing.

* @author ZMJ

*/

public class HelloWorld {

How to access Java software

public static void Main (string[] args) {

Output "Hello world!" in console

System.out.println ("Hello world!");

}

}

2) Compilation of Java

Project examples

|--SRC folder name

| |--BASIC.DAY01 Package Name

|         | |--Helloworld.java file name

| |--BASIC.DAY02 Package Name

|         | |--Jframehelloworld.java file name

|--bin

| |--basic.day01

|         | |--Helloworld.class

| |--basic.day02

|         | |--Jframehelloworld.class

4. Java annotations, parts that are ignored by the Javac (compiler)

1 single-line comment//...

2 Multiline Comments/* * *

3 Document Comment/** */

5. Eclipse (solar eclipse/Eclipse)

1) from IBM Open Source, has eclipse.org Foundation maintenance development is the mainstream Java development platform, can develop: PHP, Ruby, Android Sun is very good for this software. Eclispe is developed in Java and requires a JDK to run

2) eclipse.org Download

3) JDK:java.sun.com

If there is an imperfect place please make more comments, please indicate the source when forwarding!

Java language Basics

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.