Java for C# developers
What is the fastest-track set of resources for a C# developer wishing to hit the ground running in an enterprise-class Java team?
The language itself should be simple to understand. There are not as many language constructs, everything possible is done in libraries.
The libraries will take some getting used to. The two most critical things you can do to hit the ground running is:
1: Use NetBeans or Eclipse and hit ctrl-space ALL THE TIME. It's like the god key.
2: bookmark this page: https://docs.oracle.com/javase/8/docs/ (or the one appropriate for your version of java--but the version doesn't matter all that much) Each box in the graphic represents a library package, click one ones that you want to have an overview of. Try to get a handle on what each package does. Browse the packages that are of interest and scan the classes. This page also links to a lot of tutorials.
After that it's just a matter of learning what other libraries you'll need to do your job. there is a lot to J2EE if your group uses that, you'll probably end up using Hibernate, and you should look into messaging & maybe RMI (you may not be using it directly, but nearly all intra-java communications are based on RMI).
remember ctrl-space. It will give you parameters, lists of functions that match what you've typed so far, it fills in import declarations, it expands macros, ...
Oh, and two other Eclipse tricks: ctrl-shift-T. "Lookup Type" (in eclipse, there is one in NetBeans but I can't remember the key sequence, ctrl-shift-O maybe). Anyway, you type in a partial classname and it will give you a list of ALL matching classes in your project. Click one to open it.
ctrl-click. Jumps to the declaration/definition of whatever you click on.
I would suggest the following books:
- Java Enterprise in a nutshell, O'Reilly
- Effective Enterprise Java
- Java Enterprise best practices, O'Reilly
Java really is a different kettle of fish - there's a lot more to developing enterprise apps than there is to C#. You have all kinds of different things to worry about - EJB's, Enterprise vs. "Personal" runtimes, etc etc..
The best advice I can give you is to use the NetBeans IDE. It is big, slow and cumbersome, but it does guide you for most of the way.
Be prepared for abstractions. Lots and lots of abstractions ;)
Read the API documentation for packages java.lang
, java.io
, and java.util
. Seriously. The mark of an amateur, in java, is someone writing a loop when there is a method in java.util.Collections that already does what they want.