"Java from Beginner to Mastery" chapter first to second study notes

Source: Internet
Author: User
Tags java se

The 1th chapter of the first knowledge of Java

*java Development of the three directions: 1, Java SE: mainly for the development of desktop programs, 2, Java EE: mainly for the development of Web programs, 3, Java ME: mainly for the development of embedded system programs.

*java The main characteristics of the language: 1, Object-oriented, 2, distribution: can be placed on a number of different hosts on the relevant operations, while the data can also be stored on a number of different hosts, Java can rely on the URL object access to network objects, access and access to the local system the same; 3. Portability: Java programs are independent of the platform system, processing bytecode files through the JVM to suit different platforms; 4. Security: Remove the syntax of pointer, memory management, etc. in C language, avoid illegal memory operation. At the same time, the Java program through code validation, pointer verification and many other tests can be run; 5, Multithreading: Java allows applications to perform multiple tasks concurrently, and the corresponding synchronization mechanism can ensure that different threads can share data correctly; 6. High performance: Java compiled bytecode is run in the interpreter , it runs much faster than most interactive applications, 7, explanatory, robust, dynamic, etc...

*JDK installed environment variable configuration: 1, Java_home: Point to the JDK installation directory, Eclipse and other software is to search for the variable value corresponding path to find the JDK, 2, Path: Add "%java_home%\bin;" in the starting position. The function is to specify the command search path, when executing the command under the shell, the system will find the corresponding command program in the path specified by the path variable (the bin directory contains frequently used executable files such as Javac/java/javadoc, etc.). After you set the path variable, you can execute tools such as Javac/java in any directory; 3, CLASSPATH: The function is to specify the search path of the class used in the application the JVM is looking for classes by classpth.

* First Java program

 Public classmyapp{ Public Static voidMain (string[] args) {System.out.println ("My Java application!"); }}//stored in the D-packing directory, D:\MyApp.java//Enter the Shell D drive letter, enter Javac Myapp.java//with Dir You can find a Myapp.class file in the D-Packing directory//This is what the Javac command does: Generate a bytecode file for the source program//in the D-Disk directory, enter Java MyApp//output can be seen in the shell window: My Java application!//Here the Java command is the bytecode file that was generated before the run, i.e. Myapp.class//However, it is important to note that this is not possible with Java Myapp.class

The 2nd chapter is familiar with Eclipse development tools

*eclipse is an open source IDE integrated development tool developed by IBM in the Java language.

* Write Java programs using eclipse:

1, first create a Java project through "New", and enter the project name, assumed to be myapp;

2, continue to create a Java class through "new", enter the class name should be aware that the class name must be consistent with the project name, here is MyApp;

3, after creating the completion class, eclipse will automatically open the code editing area, enter the code to complete the programming;

4, after the completion of the code can be executed by "run" program, or ctrl+f11 shortcut keys.

5. Breakpoint settings: You can double-click the line number in the line where you want to set the breakpoint, or select Toggle Breakpoint setting or delete;

6, run the program in debug mode: Right click on the program code to select "Debug mode"/"Java Application" (or through the menu), the debugger will execute to the breakpoint suspend the current thread to suspend the program;

7, program debugging: After the program is paused, you can skip to the next executable point by stepping on the Debug toolbar (corresponding to the shortcut key F5) so that the execution jumps into the calling method or the object's internal stepping program, or by stepping through (corresponding to the shortcut key F6) to run a separate line of program code.

"Java from Beginner to Mastery" chapter first to second study notes

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.