views:

104

answers:

5

I currently am pretty sufficient in python, but I need to learn Java. Are there any books that would be specifically tailored to someone like me? Also, do you have any tips, or just any great Java books in general?

+2  A: 

Excellent book SCJP Sun Certified Programmer for Java 6 Exam 310-065

Adnan
Not the way to learn Java.
duffymo
+1  A: 

I really like these:

And I just found this Java Vs Python Comparison which gives a good treatment of the language differences.

Remember though, there isn't necessarily a direct translation. Just as there is a "Pythonic" way to do things, so there is a Java way. Ask here when you get stuck!

Ninefingers
+4  A: 

I love Bruce Eckel books: Thinking in Java: The definitive introduction to object-oriented programming in the language of the world wide.

If you want something lighter: Head First Java.

I am sure you will find Python much more enjoyable :-)

rtacconi
+1 Thinking In Java is good
naikus
A: 

I would personally go via Jython - in order to accommodate myself with the JDK library. Then I'd start porting parts of my Python code in Java in order to understand the new idioms. All the books suggested by the previous answers are invaluable sources of information and really should be used as references.

Daniel Voina
+1  A: 

I learned them in the opposite order, but my guess is that the hardest things to get used to will be explicit typing, and the workarounds you'll need to go through to create equivalents for some common python constructs like decorators, yield, and list comprehensions.

I'd suggest getting comfortable especially with the java collections framework (java.util package, mostly) and get comfortable with moving things around between sets/maps/lists, etc. etc. You'll probably experience a bit less brain overload if you ignore generics until you've got that sorted out.

Compiling is another thing that's quite different, make sure you understand classpath/compiling. It's not very complicated, but lots of ide's hide it from you (java has excellent ide support) and it'd be worthwhile to at least be able to do compile/run from the command line. Again, that's not huge, but it's certainly different.

Steve B.