tags:

views:

519

answers:

19

I'm pretty fluent in C#, but maybe need to go over to the dark^H^H^H^H other side and code some Java again. I'm ok with the Java language, as well as OO in general. But I want to learn some more about whats special in Java, as well as, if possible, whats different for me as a C# developer. Especially I need to catch up on some GUI stuff.

This would sort of be the opposite of the this question: Can you recommend a good C# windows programming book (for Java developer)

+1  A: 

As someone who just went from Java to C# recently, I would actually recommend just googling around for this one. There are some great comparison/contrast pages out there. I bought a book on C# that pointed out the differences from Java, but now wish I had just stuck with googling.

chessguy
+2  A: 

Take a look at Effective Java 2ed by Joshua Bloch.

Not specifically for C# programmers, but gives a good feel for idiomatic Java.

Seb Rose
A: 

If you know the basics of Java, and it sounds like you do, then I would start to look into Java specific constructs that are built into the language....

things such as the Observer, Observable interface (especially for implementing MVC in your "GUI stuff), toolkits like Swing and SWT, the threading model, etc..

mmattax
Observer and Observable?! That's a bit 1.0.
Tom Hawtin - tackline
A: 

I would recommend "Java Cookbook" as it can show you how to do things you may already know in C#.

metadave
+4  A: 

If you're already comfortable with OO, I would suggest focusing on threading and the Java memory model.

These things are pretty Java-specific, and really handy to know -- a lot of GUI programming issues are actually threading issues (running tasks off of the Swing EDT without deadlocking, etc).

A great book for this is Java Concurrency in Practice.

Rob Dickerson
+4  A: 

Thinking in Java, by Bruce Eckel, just because I think it's the best book on Java (not for any moving-from-C# reasons).

Paul Reiners
+1  A: 

hi there,

"Core Java", volume 1 and 2 give good coverage to both the server side and GUI side of Java. Apart from Bruce Eckel's "Thinking in Java", I cannot recommend any other book which has decent coverage of java fundamentals, GUI fundas and some server side info.

Java Power Tools, from O'Reilly is also a decent 2nd or 3rd Book on Java. But I would read this book only after the above books.

BR, ~A

anjanb
+4  A: 

Since you already know C# and due to the similarities between the languages I think that the best place to start would be to understand the differences between the languages. With that in mind I would suggest that you read these:

Java (J2SE 5.0) and C# Comparison
Comparison of Java and C Sharp
Comparison of C# with Java: A Developer Perspective

Andrew Hare
A: 

This is an excellent comparison between the languages:

http://www.extremetech.com/article2/0,2845,11777,00.asp

I would also look into Java IDEs such as Eclipse or NetBeans. Start learning how to use one...

Demi
+3  A: 

I still think the official Java tutorials are good enough even if you know C#, just skim them.

You can find a lot of resources on the web about how C# is different from Java.

However, some of them are outdated, as C# continued advancing while Java stagnated. IMHO it is better to assume that most of the good stuff is not there, and use the tutorials to see what is available.

Uri
+6  A: 

Read this: http://java.sun.com/docs/books/tutorial/reallybigindex.html

Joe Philllips
Very good stuff. It massive and you (Polaris) may know a lot of it but its definitely worth it if you skim through the stuff you care about.
Anton
Covers most of the concepts in the JRE, so it is a good place to start.
Thorbjørn Ravn Andersen
+2  A: 

Given your C# background, you can probably skip the normal introductory stuff and go straight to Thinking in Java.

(By "normal introductory stuff" I mean Head First Java, which will probably seem too basic for someone who already has a grasp of a similar language. The Java Tutorials mentioned by @Uri are probably still a good resource for you.)

Bill the Lizard
I disagree, Eckel's book is huge and unnecessarily verbose. This is not the rapid learning sought here.
FarmBoy
@FarmBoy: It's a huge book because it covers a lot of material. I didn't find it unnecessarily verbose at all. Skim it and concentrate on the sections you need.
Bill the Lizard
+1  A: 

Read Java for Dummies.

mcandre
+6  A: 

Since you have a C# background, you'll understand what I'm about to say:

The best way to learn a language is to use it!

So, pick something you've been wanting to do for fun, say a game or a simple program, make a basic design for it (you can draw upon your C# knowledge for the design, as there are enough parallels that you can map to it) and make it!

Once you've made it, make it better!

That's the only way to truly learn. You can do plenty of hello world style tutorials and learn nothing, or you can spend a weekend working on a cool, fun project and learn volumes.

glowcoder
Sure, to learn Java in general that's great, but it would also be great if I had a resource to point out some gotchas when going from just C# to Java. Thnx though.
Peteter
I guess that's a valid point. I think my point was the easiest way (perhaps not the best) to learn those gotchas is to run into them in a real (or real-esque?) situation.
glowcoder
A: 

Once you feel comfortable with the basics, jump right into Effective Java.

Hank Gay
+1  A: 

You might be interested in a Java cheatsheet for c# programmer

It maps most basic functions into both C# and Java so you won't feel too lost when browsing the API. Of course there is no better way than using the language itself. Practice makes perfect!

Eric
+1  A: 

If you can get past it's hokey-ness, try working through the exercises at JavaRanch's Cattle Drive.

GreenMatt
A: 

Java in easy steps. Best guide for beginners

soden
A: 

Java was the de facto teaching language in most universities last time I checked.

Seriously though, I have to second glowcoder's advice about picking up a hobby project. Sure, you can gain knowledge from a bunch of tutorials. But starting a project will make you apply that knowledge, inform you where your gaps in knowledge are so you can fill them, and generally give you the practise you need. This will work for just about every technology. Also, a project will also make you learn Java's standard library, which is really the biggest thing most programmers would have to get a handle on when picking up a new language.

Also, you know C#. You're halfway to learning Java already.

AJM