stackoverflow上Java相关回答整理翻译
jopen
9年前
stackoverflow-Java-top-qa
对stackoverflow上Java相关、投票数TOP100的问答进行翻译,欢迎点star,我们会持续更新!!! 为了让“翻译”更有意义,给阅读者带来更多、更有效的收获,我们会有一些加工: 例如,对问题进行分类,整合多个答案、删除冗余内容、加上自己的验证结果、心得等等 对于参与翻译的人,这也是很好的一个学习、理解过程,欢迎大家一起来翻译
如何参与翻译(欢迎加入翻译组QQ群485011036)
如何参与:
- 请从下文“待翻译问题链接”中寻找你感兴趣的问答进行翻译。翻译好的问答,放到contents目录下,无需更新readme.md文档。之后提一个PR,我会对你的翻译做一个审校,并更新到readme中。
- 另外,为了避免多人重复新翻译一个问题,你可以提issue,说明你计划翻译的问题及时间点,我可以先更新到下面的”未翻译问题“中,说明已有人领了这个问题。当然,也不一定要提issue,一般情况下,只要及时提pr,我及时审核,出现”撞车“的概率并不高。
一些基本的约定:
- 文档的文件名,和stackoverflow上的url保持一致。例如,http://stackoverflow.com/questions/8710619/java-operator 的文件名, 就是java-operator.md
- 在每篇翻译文档内容的最后,要附上stackoverflow的原文链接
每个人可以做(但不限于):
- 找未翻译的问题进行翻译
- 优化已翻译的问题
- 输出问答精简汇总版(把所有的问答集中到一个md文件,然后尽量精简,让别人可以在一天内把这100个问题的精髓都看完)
- 输出gitbook版本(现在直接在github上查看,体验不好)
目录
基础语法
- Java += 操作符实质
- 将InputStream转换为String
- 将数组转换为List
- 如何遍历map对象
- public,protected,private,不加修饰符。有什么区别呢?
- 如何测试一个数组是否包含指定的值?
- 重写(Override)equlas和hashCode方法时应考虑的问题
- 从一个多层嵌套循环中直接跳出
- 如何将String转换为Int
- 如何分割(split)string字符串
- 在java中如何对比(compare)string
Map<Key,Value>
基于Value值排序- `HashMap和Hashtable的区别
- 如何便捷地将两个数组合到一起
- Java 是否支持默认的参数值
- Java 产生指定范围的随机数
- JavaBean 到底是什么
- wait()和sleep()的区别
- 能否在一个构造器(
constructor
)中调用另一个构造器 finally
代码块总会被执行么- 如何将String转换为enum
- 在Java中声明数组
- 反射是什么及其用途
- 为什么不能用string类型进行switch判断
- 比较java枚举成员使用equal还是==
编程技巧
- 去掉烦人的“!=null"(判空语句
- 获取完整的堆栈信息
- 如何用一行代码初始化一个ArrayList
- 初始化静态map
- 给3个布尔变量,当其中有2个或者2个以上为true才返回true
- 输出 Java 数组最简单的方式
- 为什么以下用随机生成的文字会得出 “hello world”?
- 什么在java中存放密码更倾向于char[]而不是String
- 如何避免在JSP文件中使用Java代码
- Java 源码里的设计模式
- 如何产生一个随机的字母数字串作为 session 的唯一标识符
- 如何创建单例
- 实现Runnable接口 VS. 继承Thread类
网络
性能
测试
Android
待翻译问题链接(还剩x问题)
- Why is subtracting these two times (in 1927) giving a strange result?
- Proper use cases for Android UserManager.isUserAGoat()?
- Creating a memory leak with Java [closed]
- Why is printing “B” dramatically slower than printing “#”?
- How can I create an executable jar with dependencies using Maven?
- Why is executing Java code in comments with certain Unicode characters allowed?
- Dealing with “java.lang.OutOfMemoryError: PermGen space” error
- Convert a String to an enum in Java
- Android SDK installation doesn't find JDK
- Java inner class and static nested class
- 'Must Override a Superclass Method' Errors after importing a project into Eclipse
- Fastest way to determine if an integer's square root is an integer
- How to fix: Unsupported major.minor version 51.0 error?
- How to generate a random alpha-numeric string?
- Comparing Java enum members: == or equals()?
- Failed to load the JNI shared Library (JDK)
- How to create a Java String from the contents of a file?
- How can I convert a stack trace to a string?
- How do you assert that a certain exception is thrown in JUnit 4 tests?
- What exactly is Apache Camel?
- How can I permanently have line numbers in IntelliJ?
- How do servlets work? Instantiation, shared variables and multithreading
- Access restriction on class due to restriction on required library rt.jar?
- How do I discover memory usage of my application in Android?
- How can I generate an MD5 hash?
- Uncatchable ChuckNorrisException
- Can I add jars to maven 2 build classpath without installing them?
- Update Eclipse with Android development tools v. 23
- Setting multiple jars in java classpath
- Iterating through a list, avoiding ConcurrentModificationException when removing in loop
- Is null check needed before calling instanceof
- How does the Java for each loop work?
- What is the Java equivalent for LINQ?
- Hibernate hbm2ddl.auto possible values and what they do?
- How to round a number to n decimal places in Java
- How can I pad an integers with zeros on the left?
- Sort ArrayList of custom Objects by property
- What's the difference between @Component, @Repository & @Service annotations in Spring?
- Why is Java Vector class considered obsolete or deprecated?
- Efficiency of Java “Double Brace Initialization”?
- Why does this go into an infinite loop?
- When and how should I use a ThreadLocal variable?
- decompiling DEX into Java sourcecode
- How to create a generic array in Java?
- Why does Math.round(0.49999999999999994) return 1
- Eclipse: Set maximum line length for auto formatting?
- What is the difference between a soft reference and a weak reference in Java?
- How to create a file and write to a file in Java?
- What is the equivalent of the C++ Pair in Java?
- What is the difference between JSF, Servlet and JSP?
- How do I “decompile” Java class files?
- Useful Eclipse Java Code Templates [closed]
- Which @NotNull Java annotation should I use?
- How to call SOAP web service in Android
contributors
thx a lot:)
more link
To Be Continue ...
giantray
Email: lizeyang@foxmail.com
Blog: http://blog.csdn.net/lizeyang
2015-08-18 于珠海