Basic Java Knowledge

Source: Internet
Author: User
Tags clear screen

Computer = hardware + software

Hardware:

CPU:CPU is the core of computing and control in computer. Responsible for understanding the computer's instructions, and the implementation of computer operations.

Memory: A bridge between data and CPU interaction. The data required by the program is loaded into memory first, and the CPU is directly reading the in-memory data operations.       

Features: fast access speed. Cons: When a power outage or program exits, the data in memory is lost.

Hard drive (HDD, SSD): Data can be stored permanently, disadvantage: slow access speed. Solid-State drives: Read very fast.

Software: Software is a collection of computer instructions and data organized in a certain order. Software = data + instructions

Categories of software:

System software:

For example: Windows, Linux, Mac OS, iOS, Android (change UI)

Application software: The application software must be based on the system software to use.

For example: QQ, thunder, Fetion ...

The nature of software (what the software solves for us): improves the efficiency of human interaction with computers.

How humans interact with computers:

1. Interactive mode of graphical interface: simple, powerful.

2. Through the DOS command interaction: Features: Need to remember a large number of DOS commands, the function is relatively weak.

First, you have a console (command line Prompt window) for entering DOS commands:

How to open a console:

Way one: Start-------> All Programs---------> Accessories-----------> Command Prompt

Mode two: Start-------> Run--------> Input cmd.

This knowledge, learned through the Java Video Tutorials just downloaded, feels more rewarding.

Common DOS commands:

Drive letter: Enter below the specified disk.

Action folder:

Dir lists all files and folders under the path where the current console is located.

The CD path enters the specified path.

Cd.. fallback to the previous level of the directory.

CD \ fallback to the root directory under the current path.

MD folder name to create a folder

The RD folder name deletes an empty folder. Note: cannot be used to delete a non-empty folder.

Operation Files:

echo Data > file name Create a file and specify the data to write.

Type file name to view the specified file contents.

Del file name deletes the specified file. Note: If you follow a folder after Del, you are deleting all the files in a folder.

* Wildcard character (can match any file name)

tab content completion.

CLS Clear Screen

The upper and Lower arrow keys retrieve the last command written.

exit Close the console.

Computer language (better to interact with the computer):

The history of computer development:

Machine language: 010101010101010

assembly language represents the instructions of a computer through a large number of English words. Add 1 1

Advanced computer language: C \ JAVA \ C + + \ PHP

1993, Java original intention: machine 1994 the internet Just rise,. (GAO Commander \ Gauss Lin), transformed into the Internet-oriented computer language.

-------of Java's important features cross-platform (compile once, run everywhere).

Platform: Operating system.

The construction of the Java environment:

Jre:java the operating environment. JRE = Java Virtual machine + core class library (Files run by secondary Java virtual machines)

Jdk:java Development Toolset JDK = JRE + Java development tools.

The path to installing the JDK should be noted: it cannot have a Chinese path or a space.

Description of the JDK directory:

Bin: The Java development tool is stored.

Db:jdk7 comes with a lightweight database named Derby.

Include: the interface file that holds the calling system resource.

Jre:java Operating Environment

LIB: Core class library.

Src.zip:java Source Code

Java.exe starts the Java virtual machine to interpret and execute the specified class file.

Usage format for Java tools:

Java-specified class file

Javac.exe starts the Java compiler to compile the specified Java source files.

Write the first Java program:

First step: Create a new TXT file. Change the suffix name to java.

The second step: Java code is all written to the class above.

How to write a class:

A class can be defined using a keyword class.

Format:

Class Name {

Note: Curly braces indicate the scope of a class and can write code within the scope of a class.

Step three: Write a Master method. The main method of writing is fixed, is the entry of a program, the code from the main method to start execution,

How do I start Java compilation to compile Java's source files?

Javac format of Use:

Javac Java source files.

The problem we faced during the compilation process was to write the full path to the Java source file each time it was compiled. Bother!!!

Solution: If you can find Java development tools under any path, the problem is solved.

Write the file name of an executable in the console in the following principle:

In the console to write an executable file name, then the system will first in the console current path down the search for the existence of the file, if you can find the specified file,

Then, if the file is not found, the system will search for the specified file according to the path information saved by the environment variable of path, if

Can be found, then execute the file.

To configure the PATH environment variable:

How to find the environment variable for path:

My Computer-------Properties------------> Advanced system Settings----------> Advanced---------> Environment Variables------------path

Copy the path where the Javac is located to the PATH environment variable.

Basic Java 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.