如何从Java迁移到C#? [英] How do I move from Java to C#?

查看:72
本文介绍了如何从Java迁移到C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很了解Java。哪些警告和资源将帮助我尽可能轻松地跨越另一方(C#)。

I know Java well. Which caveats and resources will help me cross to the other side (C#) as painlessly as possible.

推荐答案

最大提示:一起去单词go中的 .NET命名约定。通过这种方式,您将不断被提醒您所处的语言。(听起来很傻,但它确实很有帮助。)尽可能地接受语言的习语。

Biggest tip: go with the .NET naming conventions from the word go. That way you'll constantly be reminded about which language you're in. (Sounds silly, but it really is helpful.) Embrace the idioms of the language as far as possible.

在您的情况下,有各种各样的专门针对人们的书籍 - 在亚马逊中搜索C#for Java,您将获得大量的点击量。值得仔细阅读 ,以确保您不会认为C#中的内容与Java相同。 (例如,在C#实例中,变量初始值设定项在基类构造函数体之前执行;在Java中它们发生在它之后。像这样的微妙的事情可能需要一段时间才能学习,如果你正在浏览,很容易错过。)

There are various books specifically for folks in your situation - search for "C# for Java" in Amazon and you'll get plenty of hits. It's worth reading carefully to make sure you don't assume that things will work the same in C# as in Java. (For instance, in C# instance variable initializers are executed before the base class constructor body; in Java they happen after. Subtle things like this can take a while to learn, and are easy to miss if you're skimming.)

如果您打算使用C#3,我会得到一本绝对涵盖的书 - C#3中的所有内容对您来说都是新的。免费插件:我自己的书( C#in Depth )涵盖C#2和3,但假设您已经知道C#1。 (换句话说,它本身是不够的,但你可能希望它作为第二书。)

If you're going to be using C# 3, I'd get a book which definitely covers that - everything in C# 3 will be new to you. Gratuitous plug: my own book (C# in Depth) covers C# 2 and 3, but assumes you already know C# 1. (In other words, it won't be enough on its own, but you may want it as a "second" book.)

这篇关于如何从Java迁移到C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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