7 ms·
Learn Java in Minutes
- krelian 13y agoI think we are getting into spam territory with this site.
- tzm 13y agoIt may be perceived to be spammy with the frequency of front-page posts, but the site is anything but "spam". I find the site quite useful.
- avargas 13y agoI 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>
- twiceaday 13y agoI think these articles are a decent cheat sheet beginners can reference when writing their first few programs. Annotated example code is extremely useful.
- m_gloeckl 13y agoOf 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.
- olalonde 13y agoIt's getting tiresome to always see this same comment on every post of this kind. Let's keep the semantics arguments off HN.
- thejosh 13y agoIt's more of a "kickstart your Java knowledge" I guess. Sam can't teach you to become an expert in 24 hours, but you can get a better knowledge if you come from another language / have seen Java before.
- Lapsa 13y agoI just learned it! and it was damn easy! brb, fixing my resume.
- ajanuary 13y agoI always just replace it with "Learn enough X to read a codebase in Y Minutes"
- joelg236 13y agoYou 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)
- huherto 13y agoConvert integer to string... "" + 123;
- deleted 13y ago[deleted]
- danbruc 13y agoThis makes my eyes bleed.
- drmr 13y ago.. and then forget it in seconds.
- thewarrior 13y agoThe faster you learn something the faster you forget it.
- trailfox 13y agoThat's why guys who finish bottom of their class remember the most.
- thewarrior 13y agoWell 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.
- antonmaju 13y agoPeter Norvig said otherwise http://norvig.com/21-days.html http://norvig.com/21-days.html
- gprasanth 13y agoAnd hence the missing variable Y. It has to be declared, defined, initialized, incremented, kept track of by the person reading the source.
- dallos 13y agohttp://norvig.com/jscheme-design.html http://norvig.com/jscheme-design.html "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."
- adambard 13y agoI'm so sick of this link!
- chunkylover53 13y agoyou learn it and forget it.
- hmottestad 13y agoThis 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.
- kodeater 13y agoIf 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.
- nnq 13y agolooking 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.
- kaeruct 13y agoSee http://bonsaiden.github.io/JavaScript-Garden/ http://bonsaiden.github.io/JavaScript-Garden/
- olalonde 13y agoGreat 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).
- adambard 13y agoExists in a fork, just waiting on the pull request: https://github.com/adambrenecki/learnxinyminutes-docs/blob/master/javascript.html.markdown https://github.com/adambrenecki/learnxinyminutes-docs/blob/m...
- deleted 13y ago[deleted]
- benburton 13y agoThe class name should really be upper camel case...
- kriro 13y agoIt 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.
- edtechdev 13y agoLike 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/ http://alloyui.com/rosetta-stone/ And also see Rosetta Code http://rosettacode.org/wiki/Rosetta_Code http://rosettacode.org/wiki/Rosetta_Code
- nns 13y agoA lot of libraries these days come with a Docco[1] annotated code and examples [2]. This looks very similar, but could make use of Docco. [1]http://jashkenas.github.io/docco/ http://jashkenas.github.io/docco/ [2] http://documentcloud.github.io/underscore/docs/underscore.html http://documentcloud.github.io/underscore/docs/underscore.ht...
- mavroprovato 13y ago// Import all "sub-packages" import java.lang.Math.*; Nope, you don't import all subpackages with this, you import all the static methods defined in the java.lang.Math class
- deleted 13y ago[deleted]
- eonwe 13y agoFor static import you would need to do import static java.lang.Math.*; The current version would just import all the classes defined in package java.lang.Math (which does not exist, but java.math does).
- Proleps 13y agoAll these Learn x in y minutes are really good cheat sheets. They are also pretty nice to check out before you start on a longer tutorial.
- yati 13y agoI would really like to see a "Learn C++ in minutes" post.
- rodolphoarruda 13y agoUff, I got spoiled by Python's simplicity last week when I checked its page... Java is way more complex to follow through.
- petercooper 13y agoI'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.
- adnam 13y agoExactly. The hard part of Java is not the language per se, but the myriad of IDEs and XML configuration files.
- kryten 13y agoTo 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.
- spullara 13y agoI haven't used an XML config file in literally years. Either use embedded Jetty directly or use a nice thin wrapper like DropWizard.
- brown9-2 13y agoIs there any language this is not true of?
- midnitewarrior 13y agoI'm surprised that anybody would be interested in learning Java after seeing the poor stewardship Oracle has put into the platform.
- randomchars 13y agoWell 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.
- Sandman 13y agoAnd 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?
- anExcitedBeast 13y agoI feel like this might already exist, but a sheet like this for vi/vim and emacs would be tops.
- plunchete 13y agoSeems like the author forgot to learn the conventions of the language. The site looks like a good reference though
- joelg236 13y agoMy thoughts to. Indentation was all wrong.
- 727374 13y agoI'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?
- irahul 13y ago> 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>();
- wtetzner 13y agoYou can use String.format: String.format("The value: %s", theValue); http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#format(java.lang.String http://docs.oracle.com/javase/6/docs/api/java/lang/String.ht..., java.lang.Object...)
- quacker 13y ago> 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.