2018-03-11 20165235 Qi Ying Java second Week exam summary

Source: Internet
Author: User

20165235 Qi Ying Java second week exam summary after class exercise p16
    • Code writing
    • class Person {void speakHello (){System.out.print("nin hao ");System.out.println("nice to meet you");  }}  public class Xiti { public static void main (String arg[]){         Person zhang = new Person();         zhang.speakHello();}}
    • Understanding of the subject: Because this code originally the main class name is person, so I changed the code, put the main class on the Xiti, compile it javac Xiti.java and run the java Xiti result as follows

      Test P14 of textbook code completion
    • This topic let us in unbuntu with their own school number to create a folder, and the textbook 14 pages of Kernighan saved as a Java file, and compiled run, this program is used to calculate 1 to the number of four digits after the sum of the following is the program run:
    • Understanding of the Subject: This topic is to achieve a large number of sums, so I think it should be changed in the code int sum long sum , if the last data bit too long will result in distortion.

      Code compilation with package run test

      -In Ubuntu or Windows command line, build the following directory structure (refer to the accompanying drawings)

2016XXXX (School number)
Src
Hello.java
Bin

    1. The contents of the Hello.java are shown in the annex
      Package isxxxx; (xxxx is replaced by your four-digit number)

    2. Compile run Hello.java, submit run result, to full screen

    3. Do git add in class; git commit, push code git to the code cloud in class
    • The running results and directory structure are as follows:
    • Understanding of the subject: the main test of this topic is the establishment of the file directory, use mkdir src , and mkdir bin build src and Bin file directory. Then write the code in SRC with the Vim editor, Mark at the top of the code, package is5235 and return to the 201652_35 directory using the command javac -d bin src/Hello.java to have the Hello.java compiled file in the bin, java -cp .:bin is5235.Hello Package the Hello.class file into the folder is5235 and run it at the same time.

      Exam Summary
    • This exam failed to submit three questions, there is a poor network reasons, but also I am slow action reasons, I hope the next exam can be better. Above the understanding of the problem may be wrong place, I hope the teacher, learn a lot of help.

2018-03-11 20165235 Qi Ying Java second Week exam 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.