Zhang Jiyue 201771010139 "Object-oriented Programming (Java)" First week study summary

Source: Internet
Author: User
Tags garbage collection java se

I study number " Object-oriented programming (java)" the first week of learning summary

Part I: Course preparation section

Fill out the course study Platform Registration account,

Platform Name

Registered Account

Blog Park: www.cnblogs.com

Tonma

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

[Email protected]

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

[Email protected]

China University Mooc:https://www.icourse163.org/

1987400371

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

Chapter I.

the first chapter is mainly about a brief overview of the Java program, his history, and the key terminology of the Java White Paper, as well as common misconceptions in Java. After learning the first piece of content, it helps us to better use Java.

    1. Java is a complete programming platform. Not only does it have a pleasing syntax and easy-to-understand semantics, but it also provides a large library of classes, including drawing capabilities, network connectivity and database functionality, security, cross-operating system portability, and automated garbage collection and other service execution environments.
    2. Java "white paper": In the Java white Paper, Sun's characteristics of Java are summarized as follows: Java is a simple, object-oriented, distributed, robust, security, architecture-neutral, portability, interpretive, high-performance, multi-threading, dynamic language.

(1) Simplicity

Ljava's grammatical style is similar to C + + but Java rejects content that is rarely used, difficult to understand, and prone to program errors in C + +, such as pointers, structs, unions, operator overloads, virtual base classes, and so on, and some third-party development environments provide a visualbasic-like drag program development tools for your style. The Java Infrastructure development environment can also run independently in a small space. Basic interpreter and class about 40KB kernel, plus standard class library and threading support about 175KB

(2) Object-oriented

L Object-oriented technology is the main feature of modern programming language, compared with C + +, the Java language is purely an object-oriented language, it has the following characteristics of object-oriented language:-object: It encapsulates the state variable of an objective entity and the corresponding method, realizes the modularization and information hiding of the programming. – Class: Provides a prototype of a class of objects that, through inheritance mechanisms, can use the methods provided by the parent class to enable code reuse. – Encapsulation (encapsulation) – Polymorphism (polymorphism) – Inheritance (inheritance)

(3) network skills

Ljava has an extended Network class library that handles TCP/IP protocols such as HTTP and FTP, which makes it easy for Java applications to open and access network objects via URLs and is a good support for network programming.

(4) robustness

Ljava has adopted a secure pointer model that reduces the likelihood of rewriting memory and crashing data, and the Java compiler has a strong memory conflict detection capability, and many errors can be found at compile time, rather than waiting until the runtime.

(5) security

L for the network, the distribution of Java must be to prevent the intrusion of viruses so Java requires that all access to memory must be implemented through the object's instance variables, thus preventing the programmer from accessing the object's private members, and also avoiding the error that can be easily generated by the pointer operation. Starting with version 1.1, Java has a digital signature class. There are fewer bugs in Java now.

(6) Neutral system structure

Lwriteonce,runanywhere

The –java program is compiled into an architecture-independent byte code.

– As long as the Java Runtime system is installed, the Java bytecode program can run on any processor, and after the Java interpreter gets the bytecode, it can quickly convert the cost to machine code.

– This allows Java to be uniformly supported at the operating system level.

(7) portability

l The size and algorithm of the basic data type are uniformly stipulated.

defines the portability interface.

(8) explanatory type

The source program of the Ljava is first compiled into bytecode by the compiler and then interpreted by the interpreter for execution

Ljava interpreter can execute Java bytecode (bytecode) directly on any machine

(9) High performance

Ljava as an interpreted language, its speed does not exceed the compiler language C, but and other interpretation of the implementation of the language such as basic, and so on, Java bytecode design so that it can be quickly and directly converted to the corresponding CPU machine code, which has a high performance.

(10) High performance

Ljava as an interpreted language, its speed does not exceed the compiler language C, but and other interpretation of the implementation of the language such as basic, and so on, Java bytecode design so that it can be quickly and directly converted to the corresponding CPU machine code, which has a high performance.

(11) Dynamic Nature

In contrast to C + +, Java is able to adapt to evolving environments, and Java libraries are free to add new methods and instance variables without affecting the execution of user programs. Ljava supports multiple inheritance through an interface to make it more flexible and extensible than strict class inheritance.

3.JavaApplet and the Internet:

Ljavaapplet refers to the user downloading Java bytecode from the Internet and running it on their own machine, a Java program running in a Web page called an applet. In order to use applets, a Java-enabled Web browser is required to execute bytecode; Lapplet supports dynamic Web technology; L Status: Because most developers are more willing to use flash, JavaScript to achieve the dynamic effect of Web pages, Javaapplet technology in the Web page Applications are gradually diluted.

    1. A brief history of Java development.

Chapter II

the second chapter mainly studies Operation Java programming environment, and describes how to download the JDK and design the environment suitable for him to run, and then through the mutation and run the program to detect that the installation program is operational. Second, use the command-line tools to build and run applets, using the integrated development environment

Part III: Experimental part

    1. Experiment Name: Experiment one 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:

installation and configuration of the lab 1 JDK :

1

Open Oracle website, ready to download Java JDK ( need to use registered user login, can register free )

website Address: http://www.oracle.com/

2

Mouse Hover Downloads, there will be relevant content, such as:

3

click on "Java for Developers" to go to the JDK download page:

4

You can see the download page as follows, but the latest:

5

This item is available at the bottom of this page , such as.

The content is probably:

(In Java Archives, we provide some Java versions of our history.)

Warning: These older The JRE and version of the JDK provide help for developers to debug problems in older systems. They are not the latest security patch updates and are not recommended for production. )

You can ignore the warning.

6

Click After downloads, go to the History version list page

7

such as downloading JDK6

8

Click the link to go to the following page, where two items are a group, Development represents the development environment, runtime environment represents the operating environment, and the last is the minor version number.

9

For example, click After the Java SE development Kit 6u45, go to the following page, select Accept, in the need to install JDK in the corresponding environment click the download link, if you are already logged in can download directly, otherwise prompt to log in. (The environment means: The JDK you download needs to be installed under that operating system (or processor), such as WINDOWS32 or 64-bit systems, linux32 or 64-bit systems . Linux Intel Itanium is a Linux system that uses the Intel Corporation Itanium processor)

    1. Configuration Environment Variables :

<1>. New system variable name Java-home, the value of the variable is the installation path of the JDK;

<2> new system variable name classpath;

<3> set path, create new JDK and JRE path values (the path must be to the Bin folder);

<4>: Press the window key +r key, open run, enter CMD, to enter the end, enter DOS;

<5>: Enter Java, Javac,java-version, and if you jump out of JDK version information, the environment variable setting is successful.

Experiment 2 Download the textbook sample package

download Web link:http://horstmann.com?/corejava.html

file name:corejava.zip

Experiment 3 run the following program from command-line compilation

Follow the steps below to experiment

(1) 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.

(2) Start a text editor (such as WordPad, Notepad, etc.) to copy the following source code. Textbook Chapter II Example 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 ();

}

}

(3) Save the program. Note: When you save the source program, the program name is the same as the main class name. So use Weicome.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) running the program

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

(6) Observe the program running results and understand the Java Basic program structure.

Lab 4 developing helloworld! with JDK command line Program.

1. Create a new TXT file named: Helloword.java

public class helloworld{

public static void Main (String []args) {

System.out.print ("Hello World");

}

}(1) Save the file in the D drive

(2) run cmd, the result of the operation is as follows

experiment 5 Download Elipse integrated development Package

Download URL:https//elipse.org

Experiment 6 using the Elipse development Program output 99 multiplication table

Design program:

/**

*

*/

/**

* @author LEnovo

*

*/

Package CFB;

public class cfb{

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 ();

}

}

}

to produce results;

4. Experiment Summary:

Through this study, I have a preliminary understanding Java programs include their history and key terminology and learn how to configure the environment required for Java program compilation. And with the help of teachers and classmates, also successfully downloaded the software needed to edit the Java language.
at the same time I also initially learned how to design a simple Java programs (such as the 99 multiplication table). In this process I also encountered a lot of difficulties, for example, because the program design and C language different error, the file name is wrong, resulting in the program can not run such mistakes, but after consulting the students TA, although it took a long time, but I still successfully completed the experiment, And the Java of the language programming has a preliminary understanding and understanding. I believe I will be more interested in Java learning later.

Zhang Jiyue 201771010139 "Object-oriented Programming (Java)" First week study 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.