Wang 201771010126 the first week of object-oriented programming (Java) Learning summary
Wang 201771010126 the first week of object-oriented programming (Java) Learning summary
Part I: Course preparation section
Fill in the Course Learning Platform Registration account,
Platform Name |
Registered Account |
Blog Park: www.cnblogs.com |
https://www.cnblogs.com/wy201771010126/ |
Program Design Evaluation: https://pintia.cn/ |
n Power of a |
Code Hosting Platform: https://github.com/ |
wy201771010126 |
Chinese University mooc:https://www.icourse163.org/ |
mooc1524624851590 |
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 features: 1. Simplicity, 2. Object-oriented, 3.4. Robustness, 5 security, 6 architecture neutrality, 7 portability, 8 explanatory type, 9. High performance; 10. Multithreading; 11. Dynamic
JVM:JVM is a javavirtualmachine (Java Virtual machine) abbreviation, the JVM is a specification for computing devices, it is a fictitious computer, is through the actual computer simulation of various computer functions to achieve.
JRE: (Javaruntimeenvironment,java Runtime Environment), a collection of environments necessary to run a Java program, including the JVM standard implementation and the Java Core Class library.
Jdk:java Development Kit (JDK) is a free software development kit (Sdk,software Development Kit) released by the solar Micro system for Java developers. The JDK is the core of the entire Java, including the Java Runtime Environment, Java tools, and the Java base Class library. The 2006 Solar Micro system announced the release of the GPL-based open source JDK, making the JDK a free software.
Java Application Program Structure features: Object-oriented programming.
The basic DOS command for Java programming: DOS commands are divided into internal commands, external commands, and batch files. Internal commands reside in memory, while external commands are separate executables, and batch processing is similar to a shell script under Linux.
internal commands are in Command.com; external commands are stored on disk, files that end with an. exe, and files with a. bat ending in a batch file.
Part III: Experimental part
- 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:
Installation and configuration of the Lab 1 JDK
Follow the steps below to experiment
(1) Download jdk8.0 from http://www.oracle.com/technetwork/java/javase/downloads ;
(2) installing the JDK;
Install jdk Two installation prompts appear during installation of the installation directory. The first time is to install the JDK, and the second is to install the JRE. It is recommended that all two are installed in a different folder in the same Java folder. (cannot be installed in the Java folder root directory, JDK and JRE installed in the same folder will be error)
as shown
1: Install JDK optional directory simply change the directory before the default installation directory \java
2: Install jre→ change →\java before directory and install JDK directory
Note: If no installation directory is required, all default settings are available. No need to make any changes, two times directly point to the next step. (3) Configure environment variables 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.
Computer → properties → advanced system settings → advanced → environment variables
System variables → new java_home variable; variable value: C:\Prograsm files\java\jdk-10.0.2
System variables → new CLASSPATH variable; variable value:. %java_home%\lib
system variable →path variable → edit; Variable value: Precede the value of the variable with%java_home\bin
System Variable Configuration complete
Verify that the configuration is running successfully cmd input "Java version"
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. 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 (); } } |
(3) 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 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,
(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.
The code is as follows:
public class test{
public static void Main (string[] args) {
System.out.println ("Hello word! ")
}
}
Experiment 5 Download Elipse integrated development Package
Download URL:https://elipse.org
Experiment 7 using the Elipse development Program output 99 multiplication table
The code is as follows:
Public CALSS chat{
public static viod main (String args[]) {
for (int k=1;k<=9;k++) {
for (int j=1;j<=k;j++) {
System.out.print (j+ "*" +k+ "*" = "+ () j*k" + "\ T");
}
Sytem.out.printIn ();
}
}
}
4. Experiment Summary:
This experiment is familiar with the basic syntax of Java, and the differences with C language, writing applications to receive command line parameters, writing applications to receive the user from the keyboard input and master strings and arrays of basic methods and other skills, especially understand the use and function of the running configuration.
Wang 201771010126 "Object-oriented Programming (Java)" The first week of learning summary