Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cc2016/stackoverflow-java-top-qa
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: giantray/stackoverflow-java-top-qa
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on May 19, 2016

  1. tianjiafanyi

    unknown committed May 19, 2016
    Copy the full SHA
    413b445 View commit details

Commits on Jun 1, 2016

  1. 修改提交空文件的问题

    unknown committed Jun 1, 2016
    Copy the full SHA
    4b61f49 View commit details
  2. Merge pull request giantray#1 from giantray/master

    update from origin
    alexduan-mel committed Jun 1, 2016
    Copy the full SHA
    3711480 View commit details
  3. Copy the full SHA
    94d6991 View commit details
  4. Copy the full SHA
    36c07fc View commit details

Commits on Jun 30, 2016

  1. Copy the full SHA
    500ee1d View commit details

Commits on Jul 25, 2016

  1. Create why-is-subtracting-these-two-times-in-1927-giving-a-strange-re…

    …sult.md
    
    这是我翻译的why-is-subtracting-these-two-times-in-1927-giving-a-strange-result这篇问答的中文版。
    gaoshihang authored Jul 25, 2016
    Copy the full SHA
    cc2ca4a View commit details
  2. Copy the full SHA
    bbe5225 View commit details

Commits on Aug 2, 2016

  1. owen1190

    owen1190 committed Aug 2, 2016
    Copy the full SHA
    a914c65 View commit details
  2. 更新已翻译问题

    giantray committed Aug 2, 2016
    Copy the full SHA
    7c7b598 View commit details
  3. Merge pull request giantray#49 from zouzls/master

    【添加翻译】how-do-servlets-work-instantiation-shared-variables-and-multithreading
    giantray authored Aug 2, 2016
    Copy the full SHA
    8101202 View commit details
  4. Merge pull request giantray#53 from ArronDon/master

    when-and-how-should-i-use-a-threadlocal-variable
    giantray authored Aug 2, 2016
    Copy the full SHA
    cbc23f1 View commit details
  5. Merge pull request giantray#54 from DaiDongLiang/master

    翻译Convert a String to an enum in Java
    giantray authored Aug 2, 2016
    Copy the full SHA
    1192526 View commit details
  6. 更新已翻译问题

    giantray committed Aug 2, 2016
    Copy the full SHA
    0c8be56 View commit details
  7. Merge branch 'master' of https://github.com/andysim3d/stackoverflow-j…

    …ava-top-qa into andysim3d-master
    
    # Conflicts:
    #	contents/lookup-enum-by-string-value.md
    giantray committed Aug 2, 2016
    Copy the full SHA
    dd26ebd View commit details
  8. 更新已翻译问题

    giantray committed Aug 2, 2016
    Copy the full SHA
    9eafdcb View commit details
  9. Merge pull request giantray#57 from gaoshihang/patch-2

    Create why-is-subtracting-these-two-times-in-1927-giving-a-strange-re…
    giantray authored Aug 2, 2016
    Copy the full SHA
    df120f9 View commit details
  10. 更新已翻译问题

    giantray committed Aug 2, 2016
    Copy the full SHA
    b609912 View commit details

Commits on Aug 3, 2016

  1. 添加gitbook

    giantray committed Aug 3, 2016
    Copy the full SHA
    2d7c9a0 View commit details
  2. owen1190 8/3

    owen1190 committed Aug 3, 2016
    Copy the full SHA
    561f48d View commit details

Commits on Aug 4, 2016

  1. Copy the full SHA
    465351b View commit details
  2. Copy the full SHA
    b11f01e View commit details
  3. Copy the full SHA
    1eeda60 View commit details

Commits on Aug 5, 2016

  1. Copy the full SHA
    e719fac View commit details
  2. Copy the full SHA
    dfc8923 View commit details

Commits on Aug 9, 2016

  1. Copy the full SHA
    cbbb387 View commit details

Commits on Aug 17, 2016

  1. Merge pull request giantray#61 from owen1190/master

    what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java.md
    lookup-enum-by-string-value.md
    giantray authored Aug 17, 2016
    Copy the full SHA
    14b2cc9 View commit details
  2. 更新已翻译问题

    giantray committed Aug 17, 2016
    Copy the full SHA
    984c94b View commit details
  3. Merge pull request giantray#63 from andysim3d/translate_create_string…

    …_from_file
    
    翻译了从文件里读入文本
    giantray authored Aug 17, 2016
    Copy the full SHA
    38708d6 View commit details
  4. 更新已翻译问题

    giantray committed Aug 17, 2016
    Copy the full SHA
    0edbc18 View commit details
  5. Merge pull request giantray#64 from owen1190/master

    翻译了what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java
    giantray authored Aug 17, 2016
    Copy the full SHA
    b940fe1 View commit details
  6. Merge pull request giantray#65 from ccrfrog/master

    what-is-the-difference-between-jsf-servlet-and-jsp finished
    giantray authored Aug 17, 2016
    Copy the full SHA
    155499c View commit details
  7. 更新已翻译问题

    giantray committed Aug 17, 2016
    Copy the full SHA
    679cce1 View commit details
  8. 更新吐槽方式

    giantray committed Aug 17, 2016
    Copy the full SHA
    1d7bcfa View commit details
  9. Copy the full SHA
    8cc8fe4 View commit details
  10. owen1190

    owen1190 committed Aug 17, 2016
    Copy the full SHA
    63083bf View commit details
  11. Copy the full SHA
    9e9aa6e View commit details
  12. Merge pull request giantray#67 from troyliu0105/master

    ADD: java-inner-class-and-static-nested-class.md
    giantray authored Aug 17, 2016
    Copy the full SHA
    1b93836 View commit details
  13. 更新已翻译问题

    giantray committed Aug 17, 2016
    Copy the full SHA
    13fd9c6 View commit details
  14. Merge pull request giantray#68 from owen1190/master

    优化comparing-java-enum-members-or-equals
    giantray authored Aug 17, 2016
    Copy the full SHA
    c5fb142 View commit details
  15. Merge pull request giantray#70 from AcceptedBoy/master

    add->whats-the-difference-between-component-repository-service-annotations-in.md
    giantray authored Aug 17, 2016
    Copy the full SHA
    60e629a View commit details
  16. 更新已翻译问题

    giantray committed Aug 17, 2016
    Copy the full SHA
    8fffae4 View commit details
  17. Copy the full SHA
    8561923 View commit details

Commits on Aug 18, 2016

  1. Merge pull request giantray#72 from AcceptedBoy/master

    【add】iterating-through-a-collection-avoiding-concurrentmodificationexception-when-re.md
    giantray authored Aug 18, 2016
    Copy the full SHA
    174194e View commit details
  2. 更新已翻译问题

    giantray committed Aug 18, 2016
    Copy the full SHA
    5ebf821 View commit details
  3. Copy the full SHA
    6280541 View commit details
  4. Copy the full SHA
    01ca924 View commit details
  5. Copy the full SHA
    6aaae68 View commit details
  6. Copy the full SHA
    86bf225 View commit details
  7. Copy the full SHA
    4631058 View commit details
Showing with 2,048 additions and 260 deletions.
  1. +40 −39 README.md
  2. +1 −0 SUMMARY.md
  3. +6 −0 contents/Eclipse-set-maximun-line-length-for-auto-formatting.md
  4. +33 −0 contents/android-sdk-installation-doesnt-find-jdk.md
  5. +1 −1 contents/avoiding-null-statements-in-java.md
  6. +5 −5 contents/comparing-java-enum-members-or-equals.md
  7. +33 −1 contents/convert-a-string-to-an-enum-in-java.md
  8. +202 −0 contents/efficiency-of-java-double-brace-initialization.md
  9. +2 −2 contents/examples-of-gof-design-patterns-in-javas-core-libraries.md
  10. +19 −0 contents/failed-to-load-the-JNI-shared-library(JDK).md
  11. +99 −0 contents/how-can-i-create-an-executable-jar-with-dependencies-using-maven.md
  12. +25 −0 contents/how-can-i-generate-an-md5-hash.md
  13. +13 −13 contents/how-can-i-initialize-a-static-map.md
  14. +29 −0 contents/how-can-i-permanently-have-line-numbers-in-intellij.md
  15. +55 −0 contents/how-do-i-create-a-java-string-from-the-contents-of-a-file.md
  16. +67 −0 contents/how-do-i-decompile-java-class-files.md
  17. +53 −0 contents/how-do-servlets-work-instantiation-shared-variables-and-multithreading.md
  18. +63 −0 contents/how-do-you-assert-that-a-certain-exception-is-thrown-in-junit-4-tests.md
  19. +80 −0 contents/how-to-create-a-generic-array-in-java.md
  20. +77 −0 contents/how-to-create-a-generic-array2-in-java.md
  21. +25 −0 contents/how-to-get-an-enum-value-from-a-string-value-in-java.md
  22. +4 −4 contents/how-to-sort-a-mapkey-value-on-the-values-in-java.md
  23. +2 −2 contents/iterate-through-a-hashmap.md
  24. +69 −0 contents/iterating-through-a-collection-avoiding-concurrentmodificationexception-when-re.md
  25. +44 −0 contents/java-inner-class-and-static-nested-class.md
  26. +3 −3 contents/java-operator.md
  27. +106 −0 contents/lookup-enum-by-string-value.md
  28. +13 −0 contents/lookup-enum-by-string-value2.md
  29. +35 −0 contents/must-override-a-superclass-method-errors-after-importing-a-project-into-eclips.md
  30. +38 −0 contents/proper-use-cases-for-android-usermanager-isuseragoat.md
  31. +2 −1 contents/read-convert-an-inputstream-to-a-string.md
  32. +40 −0 contents/setting-multiple-jars-in-java-classpath.md
  33. +75 −0 contents/sort-arraylist-of-custom-objects-by-property.md
  34. +36 −0 contents/what-exactly-is-apache-camel.md
  35. +38 −0 contents/what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java.md
  36. +46 −0 contents/what-is-the-difference-between-jsf-servlet-and-jsp.md
  37. +12 −0 contents/what-is-the-equivalent-of-the-c++pair-in-java.md
  38. +77 −0 contents/whats-the-difference-between-component-repository-service-annotations-in.md
  39. +33 −0 contents/when-and-how-should-i-use-a-threadlocal-variable.md
  40. +96 −0 contents/why-does-math-round0-49999999999999994-return-1.md
  41. +92 −0 contents/why-does-math.round-(0.49999999999999994)-return-1.md
  42. +143 −0 contents/why-does-this-go-into-an-infinite-loop.md
  43. +56 −109 contents/why-is-printing-b-dramatically-slower-than-printing.md
  44. +0 −80 contents/why-is-subtracting-these-two-times-(in-1927)-giving-a-strange-result.md
  45. +60 −0 contents/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result.md
79 changes: 40 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,21 +9,25 @@ stackoverflow-Java-top-qa
对于参与翻译的人,这也是很好的一个学习、理解过程,欢迎大家一起来翻译

-------------
### 如何参与翻译(欢迎加入翻译组QQ群485011036)
如何参与:
- 请从下文“待翻译问题链接”中寻找你感兴趣的问答进行翻译。翻译好的问答,放到contents目录下,无需更新readme.md文档。之后提一个PR,我会对你的翻译做一个审校,并更新到readme中
### 如何参与翻译
#### 如何参与:
- 请从下文“待翻译问题链接”中寻找你感兴趣的问答进行翻译。翻译好的问答,放到contents目录下,无需更新readme.md文档。之后提一个PR,我负责合并PR并更新到readme中
- 另外,为了避免多人重复新翻译一个问题,你可以提issue,说明你计划翻译的问题及时间点,我可以先更新到下面的”未翻译问题“中,说明已有人领了这个问题。当然,也不一定要提issue,一般情况下,只要及时提pr,我及时审核,出现”撞车“的概率并不高。

一些基本的约定:
#### 一些基本的约定:
- 文档的文件名,和stackoverflowhich-notnull-java-annotation-should-i-usew上的url保持一致。例如,http://stackoverflow.com/questions/8710619/java-operator 的文件名, 就是java-operator.md
- 在每篇翻译文档内容的最后,要附上stackoverflow的原文链接

每个人可以做(但不限于):
#### 每个人可以做(但不限于):
- 找未翻译的问题进行翻译
- 优化已翻译的问题
- 输出问答精简汇总版(把所有的问答集中到一个md文件,然后尽量精简,让别人可以在一天内把这100个问题的精髓都看完)
- 输出gitbook版本(现在直接在github上查看,体验不好)

#### 文档优化反馈:
请大家多多反馈,优化已翻译好的文章:可以到[吐槽区](https://github.com/giantray/stackoverflow-java-top-qa/issues/66)吐槽,也可以在已翻译文章基础上进行优化,提新的PR。文章质量的提升,需要大家一起努力!


### 目录
> 基础语法
@@ -56,6 +60,19 @@ stackoverflow-Java-top-qa
* [serialVersionUID 有什么作用?该如何使用?](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/what-is-a-serialversionuid-and-why-should-i-use-it.md)
* [为什么Java的```Vector```类被认为是过时的或者废弃的](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/why-is-java-vector-class-considered-obsolete-or-deprecated.md)
* [Java的foreach循环是如何工作的](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/how-does-the-java-for-each-loop-work.md)
* [为什么相减这两个时间(1927年)会得到奇怪的结果](/contents/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result.md)
* [该什么时候使用 ThreadLocal变量,它是如何工作的](/contents/when-and-how-should-i-use-a-threadlocal-variable.md)
* [servlets的运行原理](/contents/how-do-servlets-work-instantiation-shared-variables-and-multithreading.md)
* [如何计算MD5值](/contents/how-can-i-generate-an-md5-hash.md)
* [Java中软引用和弱引用的区别](/contents/what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java.md)
* [JSF, Servlet 和 JSP (三种技术)有什么区别](/contents/what-is-the-difference-between-jsf-servlet-and-jsp.md)
* [Java内部类和嵌套静态类](/contents/java-inner-class-and-static-nested-class.md)
* [@Component, @Repository, @Service的区别](/contents/whats-the-difference-between-component-repository-service-annotations-in.md)
* [如何创建泛型java数组](/contents/how-to-create-a-generic-array-in-java.md)
* [如何在整数左填充0](/contents/how-can-i-pad-an-integers-with-zeros-on-the-left.md)
* [Java里什么是与C++的Pair<L,R>相等的?](/contents/what-is-the-equivalent-of-the-c++pair-in-java.md)
* [为什么数学函数Math.round(0.49999999999999994) 返回 1](/contents/why-does-math-round0-49999999999999994-return-1.md)
* [这段代码为什么陷入了死循环](/contents/why-does-this-go-into-an-infinite-loop.md)

> 编程技巧
@@ -77,7 +94,18 @@ stackoverflow-Java-top-qa
* [如何处理 java.lang.outOfMemoryError PermGen space error](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/dealing-with-java-lang-outofmemoryerror-permgen-space-error.md)
* [如何在整数左填充0](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/how-can-i-pad-an-integers-with-zeros-on-the-left.md)
* [在调用 instanceof 前需要进行null检查吗](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/is-null-check-needed-before-calling-instanceof.md)

* [如何从文件里读取字符串](/contents/how-do-i-create-a-java-string-from-the-contents-of-a-file.md)
* [遍历集合时移除元素,怎样避免ConcurrentModificationException异常抛出](/contents/iterating-through-a-collection-avoiding-concurrentmodificationexception-when-re.md)
* [如何让IntelliJ编辑器永久性显示代码行数](/contents/how-can-i-permanently-have-line-numbers-in-intellij.md)
* [如何使用maven把项目及其依赖打包为可运行jar包](/contents/how-can-i-create-an-executable-jar-with-dependencies-using-maven.md)
* [重新导入项目到eclipse时遇到'Must Override a Superclass Method'报错](/contents/must-override-a-superclass-method-errors-after-importing-a-project-into-eclips.md)
* [如何产生一个随机的字母数字串作为 session 的唯一标识符](/contents/how-to-generate-a-random-alpha-numeric-string.md)
* [Apache Camel是什么](/contents/what-exactly-is-apache-camel.md)
* [通过对象属性对常规对象的ArrayList进行排序](/contents/sort-arraylist-of-custom-objects-by-property.md)
* [为Eclipse自动代码格式化设置行的最大长度?](/contents/Eclipse-set-maximun-line-length-for-auto-formatting.md)
* [加载JNI共享库失败(JDK)](/contents/failed-to-load-the-JNI-shared-library(JDK).md)
* [如何对Java class文件进行反编译](/contents/how-do-i-decompile-java-class-files.md)
* [如何在classpath中设置多个jar包](/contents/setting-multiple-jars-in-java-classpath.md)

> 网络
@@ -90,60 +118,33 @@ stackoverflow-Java-top-qa
* [为什么处理排序的数组要比非排序的快](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/why-is-processing-a-sorted-array-faster-than-an-unsorted-array.md)
* [如何使用Java创建一个内存泄漏的程序](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/creating-a-memory-leak-with-java.md)
* [为什么打印“B”会明显的比打印“#”慢](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/why-is-printing-b-dramatically-slower-than-printing.md)
* ["Double Brace Initialization"的效率问题](/contents/efficiency-of-java-double-brace-initialization.md)

> 测试
* [如何测试 private 方法,变量或者内部类](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/how-to-test-a-class-that-has-private-methods-fields-or-inner-classes.md)
* [JUnit4如何断言确定异常的抛出](/contents/how-do-you-assert-that-a-certain-exception-is-thrown-in-junit-4-tests.md)

> Android
* [在Android里面下载文件,并在ProgressDialog显示进度](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog.md)
* [如何获取Android设备唯一ID](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/is-there-a-unique-android-device-id.md)
* [安装Android SDK的时候找不到JDK](contents/android-sdk-installation-doesnt-find-jdk.md)
* [安卓中“UserManger.isUserAGoat()”的合适案例](contents/proper-use-cases-for-android-usermanager-isuseragoat.md)


### 待翻译问题链接(还剩x问题)
- [Why is subtracting these two times (in 1927) giving a strange result?](http://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result)
- [Proper use cases for Android UserManager.isUserAGoat()?](http://stackoverflow.com/questions/13375357/proper-use-cases-for-android-usermanager-isuseragoat)
- [How can I create an executable jar with dependencies using Maven?](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven)
### 待翻译问题链接(还剩 13 问题)
- [Why is executing Java code in comments with certain Unicode characters allowed?](http://stackoverflow.com/questions/30727515/why-is-executing-java-code-in-comments-with-certain-unicode-characters-allowed)
- [Convert a String to an enum in Java](http://stackoverflow.com/questions/604424/convert-a-string-to-an-enum-in-java)
- [Android SDK installation doesn't find JDK](http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk)
- [Java inner class and static nested class](http://stackoverflow.com/questions/70324/java-inner-class-and-static-nested-class)
- ['Must Override a Superclass Method' Errors after importing a project into Eclipse](http://stackoverflow.com/questions/1678122/must-override-a-superclass-method-errors-after-importing-a-project-into-eclips)
- [Fastest way to determine if an integer's square root is an integer](http://stackoverflow.com/questions/295579/fastest-way-to-determine-if-an-integers-square-root-is-an-integer)
- [How to fix: Unsupported major.minor version 51.0 error?](http://stackoverflow.com/questions/10382929/how-to-fix-unsupported-major-minor-version-51-0-error)
- [How to generate a random alpha-numeric string?](http://stackoverflow.com/questions/41107/how-to-generate-a-random-alpha-numeric-string)
- [Comparing Java enum members: == or equals()?](http://stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals)
- [Failed to load the JNI shared Library (JDK)](http://stackoverflow.com/questions/7352493/failed-to-load-the-jni-shared-library-jdk)
- [How to create a Java String from the contents of a file?](http://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file)
- [How do you assert that a certain exception is thrown in JUnit 4 tests?](http://stackoverflow.com/questions/156503/how-do-you-assert-that-a-certain-exception-is-thrown-in-junit-4-tests)
- [What exactly is Apache Camel?](http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel)
- [How can I permanently have line numbers in IntelliJ?](http://stackoverflow.com/questions/13751/how-can-i-permanently-have-line-numbers-in-intellij)
- [How do servlets work? Instantiation, shared variables and multithreading](http://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-shared-variables-and-multithreading)
- [Access restriction on class due to restriction on required library rt.jar?](http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar)
- [How do I discover memory usage of my application in Android?](http://stackoverflow.com/questions/2298208/how-do-i-discover-memory-usage-of-my-application-in-android)
- [How can I generate an MD5 hash?](http://stackoverflow.com/questions/415953/how-can-i-generate-an-md5-hash)
- [Uncatchable ChuckNorrisException](http://stackoverflow.com/questions/13883166/uncatchable-chucknorrisexception)
- [Can I add jars to maven 2 build classpath without installing them?](http://stackoverflow.com/questions/364114/can-i-add-jars-to-maven-2-build-classpath-without-installing-them)
- [Update Eclipse with Android development tools v. 23](http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-v-23)
- [Setting multiple jars in java classpath](http://stackoverflow.com/questions/219585/setting-multiple-jars-in-java-classpath)
- [Iterating through a list, avoiding ConcurrentModificationException when removing in loop](http://stackoverflow.com/questions/223918/iterating-through-a-list-avoiding-concurrentmodificationexception-when-removing)
- [What is the Java equivalent for LINQ?](http://stackoverflow.com/questions/1217228/what-is-the-java-equivalent-for-linq)
- [Hibernate hbm2ddl.auto possible values and what they do?](http://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do)
- [How to round a number to n decimal places in Java](http://stackoverflow.com/questions/153724/how-to-round-a-number-to-n-decimal-places-in-java)
- [How can I pad an integers with zeros on the left?](http://stackoverflow.com/questions/473282/how-can-i-pad-an-integers-with-zeros-on-the-left)
- [Sort ArrayList of custom Objects by property](http://stackoverflow.com/questions/2784514/sort-arraylist-of-custom-objects-by-property)
- [What's the difference between @Component, @Repository & @Service annotations in Spring?](http://stackoverflow.com/questions/6827752/whats-the-difference-between-component-repository-service-annotations-in)
- [Efficiency of Java “Double Brace Initialization”?](http://stackoverflow.com/questions/924285/efficiency-of-java-double-brace-initialization)
- [Why does this go into an infinite loop?](http://stackoverflow.com/questions/3831341/why-does-this-go-into-an-infinite-loop)
- [When and how should I use a ThreadLocal variable?](http://stackoverflow.com/questions/817856/when-and-how-should-i-use-a-threadlocal-variable)
- [decompiling DEX into Java sourcecode](http://stackoverflow.com/questions/1249973/decompiling-dex-into-java-sourcecode)
- [How to create a generic array in Java?](http://stackoverflow.com/questions/529085/how-to-create-a-generic-array-in-java)
- [Why does Math.round(0.49999999999999994) return 1](http://stackoverflow.com/questions/9902968/why-does-math-round0-49999999999999994-return-1)
- [Eclipse: Set maximum line length for auto formatting?](http://stackoverflow.com/questions/3697287/eclipse-set-maximum-line-length-for-auto-formatting)
- [What is the difference between a soft reference and a weak reference in Java?](http://stackoverflow.com/questions/299659/what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java)
- [What is the equivalent of the C++ Pair<L,R> in Java?](http://stackoverflow.com/questions/156275/what-is-the-equivalent-of-the-c-pairl-r-in-java)
- [What is the difference between JSF, Servlet and JSP?](http://stackoverflow.com/questions/2095397/what-is-the-difference-between-jsf-servlet-and-jsp)
- [How do I “decompile” Java class files?](http://stackoverflow.com/questions/272535/how-do-i-decompile-java-class-files)
- [Useful Eclipse Java Code Templates [closed]](http://stackoverflow.com/questions/1028858/useful-eclipse-java-code-templates)
- [How to call SOAP web service in Android](http://stackoverflow.com/questions/297586/how-to-call-soap-web-service-in-android)

1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\# Summary* [前言](README.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
为自动代码调整设置最大的行数?
问题:我正在学习Java。如果我在Eclipse Helios里使用ctrl+shift+f的组合键,它会自动调整我的代码。一定程度下,它会改变行数。我想增加行数的最大值。应该怎么做?

回答,在偏好设置里,分别点击Java->Code Style->Fomatter->edit,在菜单栏Line Wrapping下会有行的宽度选择(Maximun line width).你将需要编辑你的代码轮廓。

stackoverflow原址:http://stackoverflow.com/questions/3697287/eclipse-set-maximum-line-length-for-auto-formatting
33 changes: 33 additions & 0 deletions contents/android-sdk-installation-doesnt-find-jdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
##安装Android SDK的时候找不到JDK

###问题
我在我的win7 64位的系统上安装Android SDK时,jdk-6u23-windows-x64.exe已经安装上了,但是Android SDK的安装程序却因为找不到已安装的JDK无法继续下去。
这个问题出现过吗?有没有办法解决呢?

![](http://ww2.sinaimg.cn/large/0060lm7Tgw1f72ny3m6oaj30ds0a0gmi.jpg)

###回答1:
当你看到这个提示(找不到jdk)的时候按Back(返回),然后再点Next(下一步)。这个时候,它将会去寻找JDK

###回答2:
实际安装:

- 系统:windows 8.1
- JDK文件: jdk-8u11-windows-x64.exe
- ADT文件:installer_r23.0.2-windows.exe
安装64位JDK,然后尝试第一个回答中的back-next的方法。然后尝试设置JAVA_HOME 根据错误信息的提示,但是,仍旧对我没有用处,然后,尝试如下解决办法:

按照它说的做,设置JAVA_HOME在你的系统环境变量中,这个路径要使用正斜杠(/)而非反斜杠(\)

**注意:**
当我把JAVA_HOME设置为C:\Program Files\Java\jdk1.6.0_31的时候还是不行,但是当我设置成C:/Program Files/Java/jdk1.6.0_31的时候就ok了。快把我逼疯了。

如果还不行,就把 %JAVA_HOME%加在环境变量Path的头部。

下面是我的环境变量的配置:
- JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
- JRE_HOME=C:/Program Files/Java/jre8
- Path=%JAVA_HOME%;C:...

stackoverflow链接:
http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk
2 changes: 1 addition & 1 deletion contents/avoiding-null-statements-in-java.md
Original file line number Diff line number Diff line change
@@ -99,4 +99,4 @@ ParserFactory.getParser().findAction(someInput).doSomething();
- 如果你想返回null,请停下来想一想,这个地方是否更应该抛出一个异常

stackoverflow链接:
http://stackoverflow.com/questions/271526/avoiding-null-statements-in-java?page=2&tab=votes#tab-top
http://stackoverflow.com/questions/271526/avoiding-null-statements?page=1&tab=votes#tab-top
Loading