201772020113 Barbara "Object-oriented Programming (Java)" First week study summary

Source: Internet
Author: User

201772020113 "Object-oriented Programming (Java)" First week study summary

Part I: Course preparation section

Fill in the Course Learning Platform Registration account,

Platform Name

Registered Account

Blog Park: www.cnblogs.com

Bmwb

Program Design Evaluation: https://pintia.cn/

Bmwb

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

No landing.

Chinese University mooc:https://www.icourse163.org/

White Diffuse Guard

The following answer is yes or no

Whether to join the Course Class blog group

Is

Whether to join the course QQ Discussion Group

Is

Part II: Theoretical Knowledge Learning Section

Java core Technology One, two chapters study summary

Chapter I.

Java language Features: 1.java is not just a programming language, but a complete programming platform for a person. 2. Simplicity: The grammatical style is similar to C + +, which abandons the content of C + + which is seldom used, difficult to understand, and prone to program error; some third-party development environments provide a VB-like drag-and-drop style of program development tools; the Java Infrastructure development environment can run independently in a small space. 3. Object-oriented: Java object-oriented features and C + +, object-oriented is the main feature of modern programming language. 4. Support for network programming is good, and Java applications are easy to open and access network objects via URLs. 5.

Robustness is good, and the Java compiler can detect many problems that can be detected only at run time in other languages. For example, the biggest difference between Java and C + + is that the pointer model used by Java eliminates the possibility of rewriting memory and corrupting data. 6. High security, untrusted code executes in a sandbox environment, where it does not affect the primary system. Java code cannot run out of the sandbox, no matter where it comes from. The Java browser plugin no longer trusts remote code unless the code is digitally signed and the user agrees to execute the code. 7. Architecture neutrality. The compiler generates an architecture-neutral destination file format, which is compiled code that can run on many processors as long as there is a Java runtime system. The Java compiler implements this feature by generating bytecode directives that are not related to a particular computer architecture. Explaining the virtual machine instructions is much slower than running the machine instruction at full speed, however the virtual machine can translate the most frequently executed bytecode sequence into machine code, a process known as instant compilation. 8. Portability is strong. The size and algorithm of the basic data type are uniformly defined; The 9.Java source program is first compiled into bytecode by the compiler and then interpreted by the interpreter, and the Java interpreter can execute Java bytecode directly on any machine. 10. High performance. The speed will not exceed the C language, but the Java bytecode is designed so that it can be quickly and directly converted to the corresponding CPU machine code, which has high performance. 11.Java is the first multi-threaded language, multithreading can bring better interactive response and real-time behavior. Moore's law is coming to an end, processor single-core performance is difficult to improve, mainly focusing on multicore processors. 12. Good dynamic performance. Java can adapt to the evolving environment, the Java library is free to add new methods and instance variables without affecting the execution of the user program.

A brief History of Java development: In 1991, Sun started a green project led by Patrick Naughton and James Gosling, and found that C had many flaws, so Gosling designed a new language, oak, to solve the problem. Later, Oak changed its name to Java, meaning it had a cup of hot coffee for the world. and published in the SunWorld95. In 1999, Sun released three versions of Java: Standard Edition (J2SE), Enterprise Edition (Java EE), and mini-version (J2ME). In 2004, Java1.5 was released as another milestone in the history of the Java language. To indicate the importance of this version, Java1.5 renamed to Java5.0. In 2009, Oracle bought Sun for $7.4 billion. Access to Java Copyright. 2014, JAVA8 released. So far, Java is still evolving, from computers to irons, Java everywhere. More and more people are beginning to like it.

Chapter II

This chapter focuses on how to install the Java Development Kit (JDK) and how to compile and run different types of programs: console programs, graphical applications, and applets. The way to run the JDK tool is to type the command in the terminal window. However, more programmers prefer to use the integrated development environment.

The JDK is a software development package, and the JRE is the Java Runtime environment. After the Windows system downloads the JDK and installs it, you need to set the environment variables Path,classpath and java_home, and be careful to replace the JDK with a specific Java installation path, such as C:\Java\jdk1.8.0_31. If you want to keep the program Files section, enclose the entire path in double quotation marks: "C:\Program files\java\jdk1.8.0_31\bin"; other directories.

With command-line tools, the JDK is the most basic development tool for Java, and you can use the Eclipse software when using an integrated development environment.

Java program Development process: Source program--java Compiler--bytecode file--executed by the Java interpreter (or executed by a Web browser).

By self-study, the Welcome and viewer two simple applications were run with command-line windows and Eclipse.

Part III: Experimental part

Experiment name: Experiment a Java programming environment

Two. 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.

Three. Experimental Steps and Contents:

1. Download the available JDK version of the current system from Http://www.oracle.com/technetwork/java/javase/downloads and install it, the Windows system needs to configure the environment variables after installation ( Path and Classpath each specify the JDK command search path Hejava classpath. Setting the environment variable pass has the effect of enabling 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. )

2. Download the textbook sample package to http://horstmann.com/corejava.html Corejava.zip

3. Run the following program from command-line compilation

Create a directory D:\java. Use this directory as the working directory for the experimental program of this course. The Java source program, compiled bytecode, is placed in this directory.

Start a text editor (such as WordPad, Notepad, and so on) to copy the following source code. 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.

4. Compile the program. After the directory d:\java>, enter the following command to compile the source program into the 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.

5. Enter Java welcome after the directory d:\java> to run the compiled program. Observe the program run results and understand the Java Basic program structure. Observe the program run results and understand the Java Basic program structure.

6. Develop the helloworld! program with the JDK command line.

Program Source code:

public class HelloWorld

{

public static void Main (string[] args)

{

System.out.println (helloworld!);

}

}

After cmd compile, run output "helloworld! "。

7. Download the Elipse integrated development package

Download URL: https://elipse.org

8. Output 99 multiplication table using the Elipse development program

Package LQH;

public class Test1 {

public static void Main (string[] args) {

for (int i=1;i<=9;i++) {

for (int j=1;j<=i;j++) {

System.out.print (j+ "*" +i+ "=" +i*j+ ' \ t ');

}

System.out.println ();

}

}

}

Four. Experiment Summary:

Through this Java program Environment Design experiment, learned how to install the JDK and configure the Java programming environment. Initially learned to write simple programs using the CMD console or the Eclipes integrated development environment.

201772020113 Barbara Object-oriented Programming (Java) 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.