面向 C# 开发人员的 Java
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/555129/
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
Java for C# developers
提问by Pita.O
What is the fastest-track set of resources for a C# developer wishing to hit the ground running in an enterprise-class Java team?
对于希望在企业级 Java 团队中开始工作的 C# 开发人员来说,最快的资源集是什么?
采纳答案by Fritz H
I would suggest the following books:
我会推荐以下书籍:
- Java Enterprise in a nutshell, O'Reilly
- Effective Enterprise Java
- Java Enterprise best practices, O'Reilly
Java really is a different kettle of fish - there's a lot more to developing enterprise apps than there is to C#. You have all kinds of different things to worry about - EJB's, Enterprise vs. "Personal" runtimes, etc etc..
Java 确实是一个不同的鱼 - 开发企业应用程序比 C# 要多得多。您需要担心各种不同的事情 - EJB、企业与“个人”运行时等。
The best advice I can give you is to use the NetBeans IDE. It is big, slow and cumbersome, but it does guide you for most of the way.
我能给您的最好建议是使用 NetBeans IDE。它很大、很慢而且很麻烦,但它确实可以指导您完成大部分工作。
回答by Rex M
Be prepared for abstractions. Lots and lots of abstractions ;)
为抽象做好准备。很多很多抽象;)
回答by Click Ok
It's good to read:
读一读很好:
- http://www.ikvm.net/
- http://blogs.msdn.com/alfredth/archive/2009/01/28/java-to-c-orange-book.aspx
- http://www.infoq.com/news/2008/12/Ja-NET
- http://www.janetdev.org/
- http://www.janetdev.org/Projects/JaNETSE/Overview/tabid/88/Default.aspx
- http://www.ikvm.net/
- http://blogs.msdn.com/alfredth/archive/2009/01/28/java-to-c-orange-book.aspx
- http://www.infoq.com/news/2008/12/Ja-NET
- http://www.janetdev.org/
- http://www.janetdev.org/Projects/JaNETSE/Overview/tabid/88/Default.aspx
Love it or Hate it! :-)
爱它还是恨它!:-)
回答by Bill K
The language itself should be simple to understand. There are not as many language constructs, everything possible is done in libraries.
语言本身应该易于理解。没有那么多的语言结构,一切可能都在库中完成。
The libraries will take some getting used to. The two most critical things you can do to hit the ground running is:
图书馆需要一些时间来适应。您可以做的两件最关键的事情是:
1: Use NetBeans or Eclipse and hit ctrl-space ALL THE TIME. It's like the god key.
1:使用 NetBeans 或 Eclipse 并一直按 ctrl-space。就像神钥匙一样。
2: bookmark this page: https://docs.oracle.com/javase/8/docs/(or the one appropriate for your version of java--but the version doesn't matter all that much) Each box in the graphic represents a library package, click one ones that you want to have an overview of. Try to get a handle on what each package does. Browse the packages that are of interest and scan the classes. This page also links to a lot of tutorials.
2:将此页面添加为书签:https: //docs.oracle.com/javase/8/docs/(或适合您的 java 版本的那个——但版本并不重要)图形中的每个框代表一个库包,单击一个您想要概览的库包。尝试了解每个包的作用。浏览感兴趣的包并扫描类。此页面还链接到许多教程。
After that it's just a matter of learning what other libraries you'll need to do your job. there is a lot to J2EE if your group uses that, you'll probably end up using Hibernate, and you should look into messaging & maybe RMI (you may not be using it directly, but nearly all intra-java communications are based on RMI).
之后,只需了解您需要哪些其他库来完成您的工作。如果您的团队使用 J2EE,那么您可能最终会使用 Hibernate,并且您应该研究消息传递和 RMI(您可能不会直接使用它,但几乎所有的 Java 内部通信都基于 RMI )。
remember ctrl-space. It will give you parameters, lists of functions that match what you've typed so far, it fills in import declarations, it expands macros, ...
记住 ctrl 空格。它将为您提供参数、与您迄今为止键入的内容相匹配的函数列表、填充导入声明、扩展宏、...
Oh, and two other Eclipse tricks: ctrl-shift-T. "Lookup Type" (in eclipse, there is one in NetBeans but I can't remember the key sequence, ctrl-shift-O maybe). Anyway, you type in a partial classname and it will give you a list of ALL matching classes in your project. Click one to open it.
哦,还有另外两个 Eclipse 技巧:ctrl-shift-T。“查找类型”(在 eclipse 中,NetBeans 中有一个,但我不记得键序列,可能是 ctrl-shift-O)。无论如何,您输入部分类名,它会为您提供项目中所有匹配类的列表。单击一个打开它。
ctrl-click. Jumps to the declaration/definition of whatever you click on.
按住 ctrl 键单击。跳转到您单击的任何内容的声明/定义。
回答by paulmurray
Read the API documentation for packages java.lang
, java.io
, and java.util
. Seriously. The mark of an amateur, in java, is someone writing a loop when there is a method in java.util.Collections that already does what they want.
阅读包的API文档java.lang
,java.io
和java.util
。严重地。在 java 中,业余爱好者的标志是当 java.util.Collections 中有一个方法已经可以做他们想做的事情时,有人会写一个循环。
回答by Jan Lenoch
An understandable, structured and comprehensive wrap-up is at http://www.kynosarges.org/JavaCSharp.html.
http://www.kynosarges.org/JavaCSharp.html提供了一个易于理解、结构化和全面的总结。
It also mentions known workarounds for missing C#/CLR/BCL features.
它还提到了缺少 C#/CLR/BCL 功能的已知解决方法。