• Getting Started with Java


    “学前”说明:《Learn Java for Android》这本书内容很多,都是精华,建议大家看英文版的。在这里我不打算一一总结书中的内容,书中每章节后面的exercises都很好,非常有总结性,而且在这些习题后面还有精华的Summary,所以,我就列举下每章exercises的内容(含参考答案)以及个人根据Summary提炼的一些内容(个人觉得比较重要的可能会另外写多点)。写Blog的过程,就是我学习&温故知新的过程(一律采用英文哦,顺便学下professional English *^__^*)。下面开始:

    Chapter One :Getting Started with Java

    • Exercises:

      1.What is Java?

      Java is a language and a platform.The language is partly patterned after the C and C++ languages to shorten the learning curve for C/C++ developers.The platform consists of a virtual machine and associated execution environment.

      2.What is a virtual machine?(VM)

      A virtua machine is a software-based processor that presents its own instruction set.

      3.What is the purpose of the Java compiler?

      The purpose of the Java compiler is to translate source code into instuctions(annd associated data) that are executed by virtual machine(VM).

      4.True or false:A classfile's introductions are commonly referred to as bytecode.    (True)

      5.What does the virtual machine's interpreter do when it learns that a sequence of bytecode instructions is being executed repeatedly?

      It informs the VM's Just in Time(JIT) compiler to compile these instructions into native code.

      6.How does the Java platform promote portability?

      By providing an abstraction over the underlying platform.Thus,the source code is compiled once,but run everywhere.

      7.How does the Java platform promote security?

      By providing a secure environment in which code executes.It accomplishes this task in part by using a bytecode verifier to make sure that the classfile's bytecode is valid.

      8.True or false: Java SE is the Java platform for developing servlets.

      False.Java SE is the platform for developing apps and applets.

      9.what is the JRE?

      Jre implements the Java SE platform and makes it possible to run Java programs.

      10.What is the difference between the public and private JREs?

      The public Jre exists apart from the JDK,whereas the private Jre is a component of the JDk that makes it possible to run Java programs independently of whether or not the public Jre is installed.

      11.What is the JDK?

      The JDk provides development tools(including a compiler) for developing Java program.It also provides a private Jre for running these programs.

      12.Which JDK tool is used to complie Java source code?

      javac tool

      13.Which JDK tool is used to run Java applications?

      java tool

      14.What is Standard I/O?

      Standard I/O is mechanism consisting of standard input,standard output and standard error that makes it possible to read text from different sources(Keyboard or file),write nonerror text to different destinations(screen or file),and write error text to different destinations(screen or file).

      15.How do you specify the main() method's header?

          public static void main(String[] args),you can learn further from this.

    • Summary:

      Java is a language and a platform.The platform consists of a virtual machine & associated execution environment.

      Developers use different editions of the Java platform to create Java programs that run on desktop computers,web browser,web servers,

      mobile information devices and embedded devices.These editions are known as Java SE,Java EE,and Java ME. Of course,there is another google-created edition:Android that presents a Dalvik virtual machine running on a modified Linux kernel.

      The public JRE implements the Java SE platform and makes it possible to run Java programs.The JDK provides tools (including Java compiler)for developing Java programs and also includes a private copy of the JRE.

      two APIs:1)standard class library APIs from Oracle(or Sun?); 2)Android-oriented standard class library APIs from Google;

      JDK tools is not recommended for large project,so we need IDE,like Eclipse,Intellij IDEA...

    Next chapter introduce Java fundamentals including comments,identifiers,types,variables,expressions,statements...

  • 相关阅读:
    Android仿人人客户端(v5.7.1)——个人主页(三)
    hdu2554-N对数的排列问题
    POJ1363:Rails
    golang printf
    HDU1200:To and Fro
    [C# 基础知识系列]专题六:泛型基础篇——为什么引入泛型
    poj 2480 (欧拉函数应用)
    Re:从0开始的微服务架构--(二)快速快速体验微服务架构?--转
    爬虫推荐的工具
    python2 与 python3 语法区别--转
  • 原文地址:https://www.cnblogs.com/allenpengyu/p/3577357.html
Copyright © 2020-2023  润新知