Getting Started with Java

「學前」說明:《Learn Java for Android》這本書內容不少,都是精華,建議你們看英文版的。在這裏我不打算一一總結書中的內容,書中每章節後面的exercises都很好,很是有總結性,並且在這些習題後面還有精華的Summary,因此,我就列舉下每章exercises的內容(含參考答案)以及我的根據Summary提煉的一些內容(我的以爲比較重要的可能會另外寫多點)。寫Blog的過程,就是我學習&溫故知新的過程(一概採用英文哦,順便學下professional English *^__^*)。下面開始:html

Chapter One :Getting Started with Javajava

  • Exercises:

  1.What is Java?web

  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.express

  2.What is a virtual machine?(VM)app

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

  3.What is the purpose of the Java compiler?post

  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)this

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

  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...

 

 

轉載於:https://www.cnblogs.com/allenpengyu/p/3577357.html