Java noob的缺陷是什么? [英] What are the pitfalls of a Java noob?

查看:176
本文介绍了Java noob的缺陷是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SO上经历了一些Java问题。我必须说这里的内容是写得非常好和Java SO上的人真的可以提出答案。

I've gone through a few Java questions on SO. And I must say the content here is pretty well written and the Java guys on SO can really pump out the answers.

但我总是找到Java人的Java答案。这本身就很棒,但我是一个Java菜鸟。因此,我并不关心类型参数差异中的联合联合的工作原理。它可能很方便,但现在......它不是。

But what I always found was Java answers for Java people. Which is great on its own, but I'm a Java noob. So I don't really care for the workings of "Joint union in type parameter variance". It's probably handy down the line but for now.. it's not.

所以Java for a noob(来自PHP和Python)什么是作弊码?

So Java for a noob (coming from PHP and Python) what are the cheatcodes?

如果你可以链接到一个SO答案(可能在那里,但我找不到)或者写出Java与其他语言不同的东西是什么? (在基本层面上)

If you could link to an SO answer (which is probably out there but I couldn't find) or write up what are the things Java does differently than other languages? (on a basic level)

有些人可能称之为Java Gotchas(虽然我找不到正式版)

Some might call these the Java Gotchas (I couldn't find the official one though)

推荐答案

有一系列半官方的陷阱,被称为Java Puzzlers,并记录在同名书籍;您可能还会在网上找到一些截屏视频。 Joshua Bloch和Neal Gafter会定期提出一系列看似无害的挑战,然后系统地删除你所了解的甚至是Java语言中最模糊的基础知识的任何概念。

There's a collection of semi-official "gotchas", known as the Java Puzzlers, and documented in a book of the same name; you might also find a few screencasts on the web. Periodically, Joshua Bloch and Neal Gafter like to present a bunch of innocuous-looking challenges and proceed to systematically remove any notion you had that you understood even the vaguest basics of the Java language.

稍微不那么愤世嫉俗的说明,如果你想避免许多常见的设计和实施,你可以看看 Effective Java ,通过前面提到的Joshua Bloch,它有很多关于如何设计几个重要的 - 但经常是写得很糟糕的 - 用Java编写组件的方面的建议,包括如何正确实现<$合同的全面解释c $ c> equals()和 hashCode(),以及为什么要避免 clone()喜欢瘟疫。

On a slightly less cynical note, if you're looking to avoid many of the common design and implementation cock-ups, you might take a look at Effective Java, by the aforementioned Joshua Bloch, which has a wealth of decent advice on how to go about designing several of the important - but frequently badly written - aspects of writing components in Java, including a comprehensive explanation of how to properly implement the contract of equals() and hashCode(), and why you should avoid clone() like the plague.

哦,不要比较s使用 == 运算符转发。

Oh, and don't compare strings with the == operator.

这篇关于Java noob的缺陷是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆