I'm learning Java in my spare time just because in the same sense it pays to know C if you dig Unix, I suspect it pays to know Java if you dig the JVM.
The language has not proved to be too disturbing, happily, but I'm finding the tooling and ecosystem to be rather arcane and difficult to get a grip on at first. Build tools, a choice of JVMs and JDKs, "enterprise" this or that.. it seems all the stuff around the language is the real minefield than the relatively simplistic language itself.
To be honest, as a Java veteran, there is very little XML any more apart from a bit of Tomcat config usually. It's all gone in favor of annotations which are much better.
It ain't J2EE 1.4 days any more (thank fuck).
The only thing I've done involving XML recently was setting tomcat 7 to serve a war file from the root site and that took about 2 minutes to work out.
I can't seem to understand if people really do think they can learn a language in X minutes. It takes countless hours of writing code in a specific language to learn it, and many months of writing on it to call yourself a good programmer in that language, or expert. </rant>
I think these articles are a decent cheat sheet beginners can reference when writing their first few programs. Annotated example code is extremely useful.
Of course it would be very short-sighted to assume you could gain expert knowledge of a programming language in X minutes. However, these cheat sheets are a great way to get started in an unfamiliar environment, given that you know your basics.
You can learn to yo-yo in 5 minutes. You can also learn for years. There are different demands for different amounts of mastery. This one is just particularly low. (knowing the general ideas behind java is better than none)
It should be obvious to anyone that you won't learn JAVA by simply looking over this.
The point is that for learning it is very important to
1) Get a basic overview of terminology and a general feel for the domain (traditionally you pick up three or so books on the topic, browse through them and note similar/repeatet patterns on a very high level)...then you can break down the learning into subcomponents
2) Find a way to get started and just do it
Creating your own checklists, flash cards, high level presentation on the topic are great starting points and usually step 0 before practice, practice, practice.
This looks like an excellent first step for anyone that wants to start with JAVA.
Like someone else mentioned, they are essentially cheat sheets. Very useful if you already know some other programming language.
I especially like pages that map the features of one programming language to another (that I already know). The recent AlloyUI post was an example comparing it to jQuery and YUI: http://alloyui.com/rosetta-stone/
This looks like a great cheatsheet for those doing into to programming at uni (in java). Quick place to check on syntax without having to open a book, browse through slides or googling and ending up on a page from 1990 about how to make good coffee.
I'm actually trying to learn java from a C# background. Two questions that immediately jumped out at me:
- Do experienced java programming concatenate a bunch of strings together, or is there a format method?
-Is anyone actually using Arraylist over Generics?
Also, is including 'switch' worth the screen real estate?
> Do experienced java programming concatenate a bunch of strings together, or is there a format method?
Yeah, I've seen this a lot. IIRC, String concatenations with the + operator are compiled to use a StringBuffer for efficiency. There is also a static method String.format that works with C-like format strings.
> Is anyone actually using Arraylist over Generics?
I'm not sure exactly what you mean by this. The following is pretty standard Java, if you want a list of Strings.
List<String> list = new ArrayList<String>();
The following gives you a list of Objects (the base type for all objects in Java):
List list = new ArrayList();
If you put Strings into this list, then they come out as Objects. You'll have to cast to use them as Strings or the compiler complains.
> Do experienced java programming concatenate a bunch of strings together, or is there a format method?
If you just want to append strings, use StringBuilder(not any different from C#). If you want to format strings, use String.format(analogous to C# string.Format)
> Is anyone actually using Arraylist over Generics?
Umm. ArrayList is itself generic.
ArrayList<String> names = new ArrayList<String>();
looking forward for a Javascript version :) ...it would be serious fun to read, knowing all the horrible language gotchas that will soon byte a beginner that starts coding Js after reading only such a guide.
Great reference. I've been programming Javascript since 2005 (back then it was more copy/pasting Javascript snippets though) and still go back there once in a while (mostly for some stuff like type coercion).
If you are learning that's a good source. They never said that this would make you become an expert. thumbs up. If you already know the basics just don't read it. But everybody one day was a noob.
Well I'd be willing to bet that for the things they manage to learn and imbibe they would be quite proficient. And no matter how smart you are if you learn something as complex as the Java Syntax within just 5 minutes then you're not going to remember it well enough to apply it for very long.
And I'm surprised you made this comment. I'm no fan of Oracle, but they've done a lot more for Java then Sun did since version 6 came out in 2006. Actually, I'm interested in why you feel this way, would you care to elaborate?
Well if you want to develop for android, Java is the way to go.
Of course you could use Scala or Clojure, but without knowing Java, you probably wouldn't understand many library demos, and documentation.
"I decided I didn't want to spend more than 20 hours on this exercise of learning Java, learning the IDE I was using, and producing a Lisp interpreter."
The language has not proved to be too disturbing, happily, but I'm finding the tooling and ecosystem to be rather arcane and difficult to get a grip on at first. Build tools, a choice of JVMs and JDKs, "enterprise" this or that.. it seems all the stuff around the language is the real minefield than the relatively simplistic language itself.