Which is easier, Java or .NET? Which of the two has better prospects?
That is a dangerous question
but I'll try and be impartial. (which will probably fail).
Java was released at the end of 1996, where .Net was released at the end of 2000. So quite a gap. However, my understanding is the .Net project was started well before the release of Java - while there are many similarities, some are coincidence, some are taking an existing design and improving it. At least this is what a former microsoft employee told me. The bottom line is there is a metric tonne of Java code out there. Heaps. But .Net is catching up. Job wise, I'd be inclined to say .Net programmers are in higher demand than java at the moment.
What needs to be understood is that .Net is
not C#. .Net is many things, it is a runtime, it is a low level assembly like language (similar to Java bytecode), it's a supporting class library, etc. Just like java. However java by design ties you to writing java code (well not technically true), where C#, VB.net, C++/Cli, Boo, F#, etc are languages that compile down to .Net IL code. - So they all work together perfectly, even functional languages, etc. Mixing and matching is basically encouraged.
In a Java vs .Net battle, the .Net spec does allow a lot of very useful code related things. Examples would be the extremely good event/delegate model, attributes (reflection meta data), operator overloading, struct boxing, remoting, generics... etc. A number of these now exist in Java in a slightly different form. Each is extremely useful, and heavily used throughout the framework.
The other side of the coin is also the class library. The java class lib is ginormous, where the .Net lib is smaller. However (as a matter of opinion) I'd say the java lib is bloated and somewhat confusing. The naming schemes, for example, can differ wildy throughout java. Java has a huge set of collections, but to be honest I prefer the far more limited (but very functional) set provided by the .net lib.
an example I find appropriate is creating a directory:
new java.io.File(directoryName).mkdir();
System.IO.Directory.CreateDirectory(directoryName);
The Java version clearly has simplicity in mind. They didn't want to add a directory class, and they named the method 'mkdir' - make directory - However both of these lead to confusion if you are looking for the ability to create a directory, it's not obvious you need to create a File... The .Net version is more wordy, but it's a far more logical process to discover the method. And this, in general, is a theme that runs through .Net. It's well structured, consistently named, very wordy*, and very discoverable.
Everything within the standard lib in .Net is located in the System namespace. Two main java namespaces are java and javax.
So I'll say .Net has more features that make the learning curve steeper, but overall it's easier to climb that curve.
Both are about as easy as each other in the long run. So it's really a coin toss.
However if you are targeting mixed platforms, the choice really is Java. The breadth of Java support is huge. Not entirely consistent, but huge. From cellphones to linux to whatever, it probably will work (although not first time
). .Net really only works on microsoft platforms right now, eg windows, winCE, xbox360, etc. However there are open source efforts like Rotor, Tao and Portable.Net to support the nix platforms - but they are generally not feature complete.
Prospects wise, Java will still thrive in the nix and embedded world, however in the windows world there is no doubt in my mind .Net will be the primary platform for application development going forward (games too, imo).
Last thing I'll say is J2EE is the devil
Ok I totally lost my bias now
*there is an interface named System.Windows.Forms.IDataGridColumnStyleEditingNotificationService