Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have an excellent book for learning OOP using Java but my goal is to learn C#. How can I use that book to learn C# instead of Java? How can I know the equivalent of Java code in C#?

Is there a website for example that helps me in this?

share|improve this question
2  
thats like asking how can i learn Russian by learning Chinese – Muad'Dib Oct 21 '11 at 14:28
2  
@Muad'Dib: Java and C# are closer than that. Russian through Croatian might be closer. (The languages are related, but have diverged quite a lot in many important ways.) – Donal Fellows Nov 19 '11 at 9:14
I know there are not too many good oo books for c#.net that I know of, but this is a bit of a strange approach. – Emmad Kareem Mar 28 '12 at 13:15

6 Answers

up vote 32 down vote accepted

Don't.

If you want to learn C#, learn C#. Once you know the language and have some familiarity with the BCL (Base Class Library) and how it works, that's the time to go to your OOP Java book and study the principles.

The principles of OOP will of course apply to C#, but if you are trying to learn C#, don't focus on them, not through a Java lens, as the differences in the languages are huge (Lambda expressions don't exist in Java, generics work very differently, events don't exist in Java and more...).

share|improve this answer

One should keep in mind, that C# is no longer Java like language as it was with the first two releases. C# as it is today is much more than an OOP language. It has features of functional languages, LINQ, delegates, lambda expressions, etc. So, I would recommend mixing these two together. Try to get a good C# book instead.

share|improve this answer

Good place to start learning C# would be here: http://msdn.microsoft.com/en-us/vcsharp/dd919145

If your goal really is to learn C#, using the book first would end up having you learn Java first instead. After you get use to C# basics, then go back to the book.

share|improve this answer

For the similarities between Java and C#, I suggest referring to this article.

Otherwise, as others have already hinted, get a good C# book and learn the language directly. Although Java and C# are similar, the differences are quite important to be aware of.

share|improve this answer
5 years old, so it only compares C# 3.0, but still a very good read - very thorough. – sylvanaar Oct 21 '11 at 15:42
@sylvanaar: Yeah, it is a bit old, but still useful. It helped me out when I began learning C# while already being familiar with Java. – Bernard Oct 21 '11 at 18:12

If you have worked on any Java project during your graduation or after joining a corporate, you can try making a similar project in C#.

I am a C# developer and I learn't C# by converting an email project that I had worked on during my graduation. C# and Java are actually quite similar, from an application developer's perspective and I used this to my advantage and so can you!

Hope this helps!

share|improve this answer

I think you should separate them, that OOP book is just for OOP, don't try to learn some language things from that book, and find a another book to learn C#.

by the way, I suggest you learn C# first. Since C# being a late-comer and avoid some shortcomings of Java, you will find your C#-Sample better than the Java-sample in the OOP book. more simpler

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.