How do I move from Java to C#?

前端 未结 9 1242
花落未央
花落未央 2020-12-23 12:03

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

9条回答
  •  悲&欢浪女
    2020-12-23 12:09

    I know that a good answer has already been accepted. However, I'd like to make an addition...

    I find that learning a new language typically involves learning subtle syntactic differences....especially when dealing with the difference between languages in the C/C++/Java/C# family.

    In addition to a nice thick reference book I recommend getting a pocket reference like C# 3 Pocket Reference from O'Reilly. It won't help you with the design patterns etc...but will provide a very quick reference about the specific differences of the language you are using.

    Here's a quick blurb about this book from that site:

    C# 3.0 Pocket Reference includes plenty of illustrations and code examples to explain:

    • Features new to C# 3.0, such as lambda expressions, anonymous types, automatic properties, and more
    • All aspects of C# syntax, predefined types, expressions, and operators
    • Creating classes, structs, delegates and events, enums, generics and constraints, exception handling, and iterators
    • The subtleties of boxing, operating overloading, delegate covariance, extension method resolution, interface reimplementation, nullable types, and operating lifting
    • LINQ, starting with the principles of sequences, deferred execution and standard query operators, and finishing with a complete reference to query syntax-including multiple generators, joining, grouping, and query continuations
    • Consuming, writing, and reflecting on custom attributes

    I used this book (well the original) to help me go from being a Java to a C# developer. While I was learning, I kept it by my desk at all times and it really helped.

提交回复
热议问题