学习 Java 编程最重要的事情是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1035445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the most important things to learn about Java Programming?
提问by
I have a good understanding of object oriented programming but it's been a while since I programmed. I want to learn it again. What are the most important aspects of Java programming that are important to learn so I can identify myself as a programmer. I had trouble learning Swing before and I gave up but I want to try it again to learn it. How many years does it takes to be a good programmer?
我对面向对象编程有很好的理解,但我已经有一段时间没有编程了。我想再学一遍。Java 编程中哪些最重要的方面需要学习,这样我才能确定自己是一名程序员。我之前在学习 Swing 时遇到了麻烦,我放弃了,但我想再试一次来学习它。成为一名优秀的程序员需要多少年?
回答by Geo
I wouldn't say it takes years to learn it. You just have to write code, and learn from your mistakes.
我不会说学习它需要几年时间。你只需要编写代码,并从错误中学习。
回答by victor hugo
Some things may have changed since you left the language, here some personal proposals:
离开语言后,有些事情可能发生了变化,这里有一些个人建议:
- Servlets and JSP, you should take the dust off to this and include some EL (Expression Language)
- A build tool (Mavenor Ant), most of Java application are now built with the help of them.
- Any Web Framework (Spring MVC, Struts2or JSF are good choices)
- IoC and ORM (Springand Hibernateare good choices)
- Take a look to Apache Commonsand use them when possible
- Servlets 和 JSP,你应该去掉这些灰尘并包含一些 EL(表达式语言)
- 一个构建工具(Maven或Ant),现在大部分 Java 应用程序都是在它们的帮助下构建的。
- 任何 Web 框架(Spring MVC、Struts2或 JSF 都是不错的选择)
- IoC 和 ORM(Spring和Hibernate是不错的选择)
- 查看Apache Commons并在可能的情况下使用它们
Also some features from Java 5+ like:
还有一些来自 Java 5+ 的特性,比如:
回答by Emil H
One very important aspect is to learn the best practices of the language. One way to get up to speed about that quickly is to read Joshua Blochs book "Effective Java". I cannot recommend it enough.
一个非常重要的方面是学习语言的最佳实践。快速了解这一点的一种方法是阅读 Joshua Bloch 的书“ Effective Java”。我不能推荐它。
回答by mnuzzo
Being a good programmer isn't an issue of time so much as it is an issue of being able to perform certain tasks. Swing is certainly something you want to know if you want to make a graphics application. If you want other things to know about Java, learn how to use the collections framework, which defines different data structure interfaces in Java. Of course, learning how the data structures work and making them from scratch is nice. Other than that, it really depends on what you're going to be developing. I have found java.sun.com's APIto be invaluable
成为一名优秀的程序员不是时间问题,而是能够执行某些任务的问题。如果您想制作图形应用程序,Swing 肯定是您想知道的。如果您想了解有关 Java 的其他内容,请学习如何使用集合框架,该框架在 Java 中定义了不同的数据结构接口。当然,学习数据结构的工作原理并从头开始制作它们是很好的。除此之外,这实际上取决于您将要开发的内容。我发现java.sun.com 的 API非常宝贵
回答by Hardwareguy
I'd get a good beginners java book and go through it. A good free one is Thinking in Java http://www.mindview.net/Books/TIJ/. I'd also recommend getting a good IDE like Eclipse or Netbeans. If you want to do web development you can find some good tutorials on struts2 or JSF.
我会得到一本很好的初学者 Java 书籍并阅读它。一个很好的免费软件是 Thinking in Java http://www.mindview.net/Books/TIJ/。我还建议您使用 Eclipse 或 Netbeans 之类的好 IDE。如果你想做 web 开发,你可以在 struts2 或 JSF 上找到一些很好的教程。
回答by Igor Krivokon
I believe that practice is the most important aspect. Books give you "a map", and it's difficult to start without a map, but until you explore the territory on your own, you can't really understandit. So, pick any project that interests you, and just go ahead and implement it.
我认为实践是最重要的方面。书本给了你“一张地图”,没有地图很难开始,但直到你自己探索这片领土,你才能真正理解它。因此,选择您感兴趣的任何项目,然后继续实施它。
Regarding how many years does it take - see Teach Yourself Programming in Ten Yearsby Peter Norvig.
关于需要多少年 - 请参阅Peter Norvig 的《十年自学编程》。
回答by mikesomeone
I would start with other APIs besides Swing, unless you have a real nead for it. Apache Commons has several components, like daemon starting, logging, IO, application launching, db connection pools... And the best part is, the source is there for you to read.
除了 Swing 之外,我还会从其他 API 开始,除非您真的很需要它。Apache Commons 有几个组件,如守护进程启动、日志记录、IO、应用程序启动、数据库连接池……最好的部分是,源代码可供您阅读。
Some other things to learn: how some of Java itself works. Hunt down souce code (Suns, an opn source, it doesn't matter), look at classes like StringBuffer, and see how they work.
其他一些需要学习的东西:Java 本身是如何工作的。查找源代码(Suns,一个 opn 源,没关系),查看 StringBuffer 之类的类,看看它们是如何工作的。
Good luck space cowboy!
祝太空牛仔好运!
回答by Jon
Learn the core language well and then learn about best practices.
好好学习核心语言,然后学习最佳实践。
Understand the limitations of the language and look for ways to improve on this. Apache Commons is a good source of knowledge for this.
了解语言的局限性并寻找改进方法。Apache Commons 是一个很好的知识来源。
After that, understand and learn concurrency with Java and the underlying memory model.
之后,了解和学习 Java 的并发性和底层内存模型。
- If you need to learn a GUI framework then look at Swing or Eclipse SWT.
- If you need to learn a web application framework then pick one of the hundreds out there. I suggest looking at SpringMVC or Struts 2.
- 如果您需要学习 GUI 框架,请查看 Swing 或 Eclipse SWT。
- 如果您需要学习 Web 应用程序框架,请从数百个中选择一个。我建议查看 SpringMVC 或 Struts 2。
回答by Erich Kitzmueller
Of course you need to learn the basic features of Java before learning anything else.
Of the "advanced" language features, I would pick reflection.
当然,在学习其他任何东西之前,您需要学习 Java 的基本特性。
在“高级”语言特性中,我会选择反射。
For the GUI, there are several options. I would still pick Swing, since it is the most common tool.
对于 GUI,有几个选项。我仍然会选择 Swing,因为它是最常用的工具。
For the web, learn servlets and JSP (so you know the basics), then learn a framework (struts, JSF, etc.).
对于 web,学习 servlets 和 JSP(这样你就知道基础知识),然后学习一个框架(struts、JSF 等)。
There is no clear cut favorite in my opinion.
在我看来,没有明确的最爱。
回答by Yoni Roit
Pointers. Go back to C and learn pointers.
指针。回到 C 并学习指针。
(almost) Everything in Java is a pointer, so if you don't understand them, there's no use in any of those fancy frameworks.
(几乎)Java 中的一切都是一个指针,所以如果你不理解它们,那么在任何那些花哨的框架中都没有用处。