Dara Grass 201771010105 "Object-oriented Programming (Java)" The first week of learning summary

Source: Internet
Author: User
Tags create directory garbage collection inheritance

Dara Grass 201771010105"Object-oriented programming (java)" First week of study summary

Part I: Course preparation section

Fill in the Course Learning Platform Registration account,

Platform name

Registered account

Blog Park: www.cnblogs.com

DLC

Programming Evaluation: https://pintia.cn/

[email  protected]

Code hosting Platform: https://github.com/

Dalacao

University of China mooc:https:// www.icourse163.org/

2665087485

The following answer yes or no

Whether to join Class class blog group

Yes

Whether to join the course QQ Discussion group

Yes

Part II: Theoretical Knowledge Learning Section

Chapter I.

The first chapter is an overview of Java programming, which is described mainly from the Java design platform, the key terminology of Java "white paper", Java applets and the Internet, a brief history of Java development, and common misconceptions about Java.

1.Java is not just a language, Java is a complete platform with a huge library of reusable code and night songs that provide execution environments for services such as security, cross-operating system portability, and automated garbage collection. Java is a full-featured language, a high-quality execution environment, and a huge library.

The 2.Java white paper was used to explain the design and the situation of the Imperial palace, and it released a brief summary:

(1) Simplicity: ①java's grammatical style is similar to C + +, so C + + programmers can quickly master the Java programming language technology. ②java rejects content that is seldom used, difficult to understand, and prone to program errors in C + +, such as pointers, structs, unions, operator overloading, virtual base classes, and so on. ③ BASIC interpreter and class support is only about 40KB.

(2) Object-oriented: The face of object design is a programming technology, he will focus on the data (i.e. object) and interface.

(3) Distributed: Java has a rich example libraries for handling IP/TCP protocols such as HTTP/FTP. Java applications can open access to objects on the network through a URL that is as convenient as accessing a local file.

(4) Robustness: The Java Editor can detect many problems that can only be checked out in other languages while running. Java uses a pointer model to eliminate the possibility of rewriting memory and corrupting data.

(5) Security: Java is able to protect against various attacks, including: ① Runtime Stack Overflow. such as worms and viruses commonly used attack means. ② destroys memory outside of its own process space. ③ unauthorized Read and write files.

(6) Architecture neutrality: The compiler generates an architecture-neutral target file format, which is a compiled code that only the Java runtime system can run on many processors. The Java compiler implements this feature by generating bytecode directives that are not related to a particular computer architecture. The well-designed code can be easily interpreted and executed on any machine, and can be translated dynamically into local machine code. The virtual machine also has an option to translate the most frequently executed bytecode sequence into machine code, a process called instant compilation. Virtual machines can also detect the behavior of instruction sequences, thereby enhancing security.

(7) Portability: There is no "dependency-specific implementation" in the Java specification. The size of the base data type and the related operations are clearly explained. For example, an int in Java is always a 32-bit integer.

(8) Explanatory: The source program of ①java is first compiled by the compiler into bytecode, and then interpreted by the interpreter to execute. The ②java interpreter can execute Java bytecode directly onto any device.

(9) High energy: Java as an interpreted language, its speed will not exceed the compiler language C, single and other interpretation of the implementation of the language such as basic, etc., Java bytecode design so that it can be quickly and directly converted to the corresponding CPU machine code, thus has a high performance.

(10) Multithreading: ① Multithreading concepts are similar to multitasking, and multithreading has efficient interactive response and real-time behavior when the application is running; ②java Platform Bar A program is divided into multiple tasks to make tasks easy to complete and to maximize the use of multiprocessor resources The ③ multithreading mechanism makes Java a major development language for server-side applications.

(11) The Dynamic Java class Library is free to add new methods and instance variables without affecting the execution of the user program. Java uses interfaces to support multiple inheritance to make it more flexible and extensible than strict class inheritance.

Chapter II

The second chapter focuses on how to install the Java Development Kit (JDK) and how to compile and run different types of programs. ① Install the development kit; ② use command-line tools; ③ use an integrated development environment; ④ run a graphical application; ⑤ build and run applets.

Part III: Experimental part

    1. Experiment name: Experiment a Java programming environment

2. Purpose of the experiment:

(1) Mastering the installation and configuration of JDK;

(2) Master the basic commands and procedures for developing Java programs using JDK;

(3) The basic steps of developing Java programs skillfully using ELIPSE integrated development environment

(4) Master the basic syntax of the Java program.

3. Experimental Steps and Contents:

(1) Installation and configuration of JDK

① first download the software from the official website:

Click to open this link http://www.oracle.com/technetwork/java/javase/downloads, to download

② install JDK, install JDK after download.

③ configuration environment variables;

    1. New variable name java-home, variable value for JDK installation path

and the settings for path and classpath.

Path and Classpath specify both path and classpath specify the JDK command search path and Java classpath respectively. Setting the environment variable the role of path is to enable the operating system to find JDK commands. Setting the environment variable classpath the role of telling the Java class loader where to look for classes and user-defined classes provided by third parties. The JVM and other JDK tools find classes by searching the Platform libraries, library extensions, and classpath in turn.

    1. Confirm the environment configuration is correct;

Enter the Java, Javac, and Java-version commands separately in the console, with information such as the compile information for the JDK as shown below, including the syntax and parameter options for modifying commands.

Java command:

Javac command:

Java-version command:

(2) Download the textbook sample program installation package;

Download Web link: http://horstmann.com/corejava.html.

Click on the link to download the tenth edition.

(3) Run the following program by command compilation;

Follow the steps below to experiment

① Create directory D:\java. Use this directory as the working directory for the experimental program of this course. Java source code, compiled bytecode files are placed in this directory.

② Start a text editor (such as WordPad, Notepad, and so on) to copy the following source code. The 2nd chapter of the textbook is the sample program (Welcome.java).

/**

* This program displays a greeting for the reader.

* @version 1.30 2014-02-27

* @author Cay Horstmann

*/

public class Welcome

{

public static void Main (string[] args)

{

String greeting = "Welcome to Core java!";

System.out.println (greeting);

for (int i = 0; i < greeting.length (); i++)

System.out.print ("=");

System.out.println ();

}

}

③ Save the program. Note: When you save the source program, the program name is the same as the main class name. So use Welcome.java as the file name of this program. If you are writing a program in Notepad, the default extension for Notepad is. txt, so you want to enclose the file name in quotation marks. Save the file in the directory D:\java.

④ Compiling the program

After directory d:\java>, enter the following command to compile the source program into a bytecode program

Javac Welcome.java

If the compilation succeeds, the bytecode file Welcome.class is generated in the D:\java directory. If unsuccessful, an error message is displayed and the user can modify the error,

⑤ Running the program

After the directory d:\java>, enter Welcome to run the compiled program.

⑤ Observe the program run results and understand the Java BASIC program structure

The experiment is as follows:

(4) Develop Hello world! with jdk command line Program

The experiment is as follows:

(5) Download Elipse integrated development Package

; Download URL: https://elipse.org

(6) using the Elipse development Program output 99 multiplication table

The experimental results are as follows:

4. Experiment Summary:

This experiment because it is our first time to do experiments, so in the process of doing experiments we encountered a lot of problems, through with many attempts, also solved the problems encountered. In the first chapter of the learning process we learned that Java as a programming language, it is not just a language, it is a complete platform, Java has a large library, many of the reusable code and a provision such as security, cross-operating system portability, and automatic garbage collection services such as the execution environment. Through the second chapter of learning we learned to install the Java SDK and configure environment variables and confirm that the environment is configured correctly, as well as Elipse installation, and program writing.

Dara Grass 201771010105 "Object-oriented Programming (Java)" The first week of learning summary

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.