Feng Zhixia 201771010107 "Object-oriented Programming (Java)" First week study summary

Source: Internet
Author: User
Tags create directory thread class

201771010107 Feng Zhixia "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

www.cnblogs.com/fzx201626

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

[Email protected]

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

[Email protected]

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

E17752171725

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 One: Overview of Java programming

Java is a generic term for the Java object-oriented programming language and Java platform introduced by Sun Microsystems Company in May 1995.

Java consists of three systems:

    • Javase (J2SE) (JAVA2 Platform standard Edition,java platform version)
    • EE (Java 2 platform,enterprise Edition,java Platform Enterprise Edition)
    • Javame (J2ME) (Java 2 Platform Micro Edition,java Platform mini version).

Key Features

    • Java The simplicity of language:

The syntax of the Java language is close to the C and C + + languages, making it easy for most programmers to learn and use. Java, on the other hand, discards the rarely used, difficult-to-understand, confusing features of C + +, which does not use pointers, but references. and provides automatic scrap collection, which makes it unnecessary for programmers to worry about memory management.

Java the object-oriented nature of language:

The Java language provides object-oriented features such as classes, interfaces, and inheritance, and for simplicity, only single inheritance between classes is supported, but multiple inheritance between interfaces is supported, and the implementation mechanism between classes and interfaces is supported (the keyword is implements). The Java language fully supports dynamic binding, while the C + + language uses dynamic binding only for virtual functions. In short, the Java language is a purely object-oriented programming language.

Java the language is distributed:

The Java language supports the development of Internet applications and has a network application programming interface (Java net) in the basic Java application programming interface, which provides a class library for network application programming, including URLs, URLConnection, sockets, ServerSocket and so on. The RMI (remote method Activation) Mechanism of Java is also an important tool for developing distributed applications.

Java the robustness of the language:

Java's strong typing mechanism, exception handling, and garbage collection are important guarantees of Java program robustness. Discarding pointers is a wise choice for Java. Java's security check mechanism makes Java more robust.

Java the security of the language:

Java is typically used in a network environment, and Java provides a security mechanism to prevent malicious code from attacking. In addition to many of the security features of the Java language, Java has a security mechanism (class ClassLoader) for classes that are downloaded over the network, such as assigning different namespaces to prevent the substitution of locally named classes, byte code checks, and provides security management mechanisms (class SecurityManager) for Java applications to set up Security Sentinel.

Java language is architecture-neutral:

Java programs (files that are suffixed with Java) are compiled into an architecture-neutral bytecode format (a file with a suffix of Class) on the Java platform and can then be run on any system that implements the Java platform. This approach is suitable for heterogeneous network environment and software distribution. Java portability of language:

This portability comes from architecture neutrality, and Java also strictly specifies the length of each basic data type. Java system itself is also very strong portability, Java compiler is implemented in Java, Java operating environment is implemented with ANSI C.

Java the language is interpreted in the form of:

As mentioned earlier, Java programs are compiled into bytecode format on the Java platform and can then be run on any system that implements the Java platform. At runtime, these bytecode are interpreted by the Java interpreter in the Java platform, and the classes required during execution are loaded into the runtime environment during the join phase.

Java's High Performance:

Java is really high-performance compared to those high-level scripting languages that are interpreted. In fact, the speed of Java is getting closer to C + + with the development of JIT (just-in-time) compiler technology.

Java languages are multi-threaded:

In the Java language, a thread is a special object that must be created by the thread class or its child (grandchild) class. There are usually two ways to create a thread: one is to wrap an object that implements the Runnable interface into a thread using a constructor of type thread (Runnable), and another to derive a subclass from the thread class and override the Run method, and the object created with that subclass is a thread. It is important to note that the thread class has implemented the Runnable interface, so any thread has its run method, and the Run method contains the code that the thread wants to run. The activity of a thread is controlled by a set of methods. The Java language supports simultaneous execution of multiple threads and provides a synchronization mechanism between multithreading (the keyword is synchronized).

Java the dynamic nature of language:

One of the design goals of the Java language is to adapt to dynamically changing environments. The classes required by the Java program can be dynamically loaded into the runtime environment, or they can be loaded into the network to load the required classes. This also facilitates software upgrades. In addition, classes in Java have a run-time representation that enables type checking at run time.

Related concepts:

    1. Java Virtual Machine (JVM): Java VM is used to interact with the operating system;
    2. JRE (Java Runtime Environment): Java runtime evnironment includes core class libraries provided by Jvm+java;
    3. JDK (Java Development toolset): The Java Development Kit includes the Jre+java development toolset.
    4. Two core mechanisms of Java: ①jvm② garbage collection mechanism (GC).

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. Install the Java Development Kit: Download the JDK URL:

Http://www.oracle.com/technetwork/java/javase/downloads

A. During the download process for Windows or Linux, choose between x86 (32-bit) and x64 (64-bit) versions to match your operating system

B. Set the environment variables for the JDK as follows:

Computer--Properties--Advanced system settings-environment variables: new Classpath

New path:

After the environment variable configuration is completed, it needs to be tested, input java,javac, and observe the results.

(2) How to run the program through command-type compilation:

  1. Download Tutorial Example: file name Corejava.zip
  2. Create directory D:, Java after the Java source program and compiled bytecode files are all placed in this directory
  3. Copy the Welcome.java in WordPad
  4. Remember to keep the program name consistent with the main class name when saving
  5. Run the program
  6. Enter welcome after catalog d:\java> to run observation results
  7. Developing HelloWorld programs with JDK commands
  8. Create a new TXT file named: Helloworld.java
  9.  Public classhelloworld{ Public Static voidMain (string[] args) {String greeting="HelloWorld"; System. out. println (greeting);  for(inti =0; I < greeting.length (); i++) System. out. Print ("="); System. out. println (); }}

    Save it on the D drive, run DOS, if it is correct:

  10. Download the Eclipse Integration Development package URL: Elipse Download URL: https://www.eclipse.org/downloads/
  11. After installation, create the Java project file:
  12. Finally, a program that uses eclipse to write a 99 multiplication table:

4. Experiment Summary: Through the independent study and the exchange between the students to understand what is the JDK, the relationship between the JDK and eclipse, can not say that completely mastered the work of the two principles, at least now can be installed independently, debugging, writing a short program, and test, At present, I encountered a problem can not be fully said its reasons, the year is a step by step study, the future should be able to have a deeper understanding of the fact that this job writing program is not difficult problem because the Java language itself and we have learned the C language syntax similar, of course, this time also touched some Java syntax For example, the source file name must be the same as the class name, and if it is different, it will compile with an error, and the suffix of the file name. Java, and the class name whose initials you want to capitalize. Of course, there are many mistakes in the process, such as environmental configuration is not appropriate, in short, in the course of the experiment only to continue to try to achieve success

Feng Zhixia 201771010107 "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.