20165111 2017-2018-2 "Java programming" the first week of study summary

Source: Internet
Author: User

20165111 2017-2018-2 "Java program design" the first week to summarize the learning content of learning materials

This chapter is mainly about the Java language and the preparatory knowledge of Java learning.

Features of Java
  • Simple
  • Object oriented
  • Platform-Independent
  • Multithreading
  • Dynamic
A simple Java application
  • Write
  • Compile
javac XX.java #这里的XX所指的类必须是公开类#
  • Run
java xx#这里的XX所指的类必须是包含main方法的主类# ```> ### Java反编译> ```> javap xx> ```## 代码调试中的问题和解决过程本期因为都是对课本代码的机械输入,因此没有太多问题,多是因不习惯而产生的漏输入的问题,经过报警提醒都都能发现而得到修改,便不一一列举了。## [代码托管](https://gitee.com/stephenjoosten/20165111_zhu_siteng_java_course_code)![](https://images2018.cnblogs.com/blog/1322861/201803/1322861-20180310201046541-77458853.png)## 上周考试错题总结试题来源取自蓝墨云班课“第一周测试”- 第一类:关于Java程序编译及执行的要求的判断1.
File name Hello.java

public class Hello {
public static void Main (string[] args) {
System.out.println ("Hello World");
}
}

执行结果:编译失败(文件名与公开类名不一致).2.
File name Main.java

public class Main {
public static main (string[] args) {
System.out.println ("Hello World");
}
}

执行结果:编译失败()3.
File name Main.java

public class Main {
public static void Main () {
System.out.println ("Hello World");
}
}

执行结果:编译通过,但执行时找不到主要方法类.4.

File name Main.java
public class Main {
public static void Main (string[] args) {
System.out.println ("Hello World");
}
}

执行结果:编译失败()- 第二类:关于执行不同目录下java程序的命令行1.
Text path C:\workspace\Hello\classes work path C:\workspace

public class Main {
public static void Main (String args[]) {
System.out.println ("Hello World");
}
}

执行代码:

JAVA-CP hello/classes Main

2.
Text path C:\workspace\Hello\classes work path C:\workspace

Package cc.openhome;
public class Main {
public static void Main (String args[]) {
System.out.println ("Hello World");
}
}

执行代码:

JAVA-CP.: hello/classes Cc.openhome.Main

3.
Text path C:\workspace\Hello\classes work path C:\workspace\Hello

Package cc.openhome;
public class Main {
public static void Main (String[]args) {
System.out.println ("Hello World");
}
}

执行代码:

JAVA–CP Classes Cc.openhome.Main
```

Other

Because I did not see the template before, and did not follow the requirements of the template to write, so the last week did not hand in homework.
In the first chapter, the content of the Java language is relatively simple, and more is to continue to familiarize yourself with Linux commands, mainly about the compilation and operation of Java programs.

20165111 2017-2018-2 "Java programming" the first week of study summary

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.