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...
Getting Started with Java的更多相关文章
- Spark案例分析
一.需求:计算网页访问量前三名 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /* ...
- 故障重现(内存篇2),JAVA内存不足导致频繁回收和swap引起的性能问题
背景起因: 记起以前的另一次也是关于内存的调优分享下 有个系统平时运行非常稳定运行(没经历过大并发考验),然而在一次活动后,人数并发一上来后,系统开始卡. 我按经验开始调优,在每个关键步骤的加入如 ...
- Elasticsearch之java的基本操作一
摘要 接触ElasticSearch已经有一段了.在这期间,遇到很多问题,但在最后自己的不断探索下解决了这些问题.看到网上或多或少的都有一些介绍ElasticSearch相关知识的文档,但个人觉得 ...
- 论:开发者信仰之“天下IT是一家“(Java .NET篇)
比尔盖茨公认的IT界领军人物,打造了辉煌一时的PC时代. 2008年,史蒂夫鲍尔默接替了盖茨的工作,成为微软公司的总裁. 2013年他与微软做了最后的道别. 2013年以后,我才真正看到了微软的变化. ...
- 故障重现, JAVA进程内存不够时突然挂掉模拟
背景,服务器上的一个JAVA服务进程突然挂掉,查看产生了崩溃日志,如下: # Set larger code cache with -XX:ReservedCodeCacheSize= # This ...
- 死磕内存篇 --- JAVA进程和linux内存间的大小关系
运行个JAVA 用sleep去hold住 package org.hjb.test; public class TestOnly { public static void main(String[] ...
- 【小程序分享篇 一 】开发了个JAVA小程序, 用于清除内存卡或者U盘里的垃圾文件非常有用
有一种场景, 手机内存卡空间被用光了,但又不知道哪个文件占用了太大,一个个文件夹去找又太麻烦,所以我开发了个小程序把手机所有文件(包括路径下所有层次子文件夹下的文件)进行一个排序,这样你就可以找出哪个 ...
- Java多线程基础学习(二)
9. 线程安全/共享变量——同步 当多个线程用到同一个变量时,在修改值时存在同时修改的可能性,而此时该变量只能被赋值一次.这就会导致出现“线程安全”问题,这个被多个线程共用的变量称之为“共享变量”. ...
- Java多线程基础学习(一)
1. 创建线程 1.1 通过构造函数:public Thread(Runnable target, String name){} 或:public Thread(Runnable target ...
- c#与java的区别
经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...
随机推荐
- JavaScript之放大镜效果2
在放大图片效果的同时,我们怎么原图和放大窗体增加间隔呢? 我们只需应用一个table就行了: 源码上: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML ...
- C#调用SSIS包及读取DataReader目标
C#调用SSIS包需要引用两个DLL .(具体位置在C盘搜索,MSDN和百度提供的路径都不太正确) Microsoft.SQLServer.ManagedDTS.dll Microsoft.SqlSe ...
- 64位系统下注册32位dll文件
64位系统下注册32位dll文件 在64位系统里注册32位软件所需的一些dll会提示不兼容,大概因为32 位进程不能加载64位Dll,64位进程也不可以加载32的导致. 若要支持的32 位和64 位C ...
- 检测URL地址是否有响应
今天突然出来了一个问题,URL地址调用导致程序卡死(原因是服务挂了,磁盘坏了) 然后想到了,再调用URL地址前先判断下地址是否有响应,这样不就可以解决问题了吗? C# 代码: /// <summ ...
- CSS Sprite 雪碧图制作
CSS Sprite 雪碧图,简单来说就是: 为了提高网页的性能,减少加载次数,将一些不会经常随网站内容变化的小图标,集中放在一张大图上,将该图应作为background-image 嵌入页面中,在需 ...
- 利用CSS3打造一组质感细腻丝滑的按钮
CSS3引入了众多供功能强大的新特性,让设计和开发人员能够轻松的创作出各种精美的界面效果.下面这些发出闪亮光泽的按钮,漂亮吧?把鼠标悬停在按钮上,还有动感的光泽移动效果. 温馨提示:为保证最佳的效果, ...
- java与C#用protobuf通信--java如何转换protobuf-net中的bcl.Decimal对象
公司内部有些C#服务使用proto-net,引入了bcl.proto中的bcl.Decimal.bcl.DateTime等.对于java的proto生成代码需要对bcl.Decimal.bcl.Dat ...
- Linux命令行提示符设置
我们使用Linux系统时接触最多的是它的命令行窗口,很多时候我们都需要在命令行上输入命令,在输入的命令前都会有提示符,一般系统默认的提示符形式是:[username@host 工作目录]$. 其实,我 ...
- 【Qt】Qt国际化(系统文本-QMessageBox按钮、QLineEdit右键菜单等)【转】
简介 使用Qt的时候,经常会遇到英文问题,例如:QMessageBox中的按钮.QLineEdit.QSpinBox.QScrollBar中的右键菜单等.通常情况下,我们软件都不会是纯英文的,那么如何 ...
- silverlight 文本框只能输入汉字
private void txtName_KeyDown(object sender, KeyEventArgs e) { Regex rg = new Regex("^[\u4e00-\u ...