Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

(Originally Posted on Stackoverflow) I'm sorry if this question is not appropriate for stackoverflow, I know this is not a technical question, but I feel like it is relevant. I have always been interested in programming, I have messed around with many programming languages and different game engines, making simple apps and things like that. I have been doing Java for a little over a year. Because of school, I did Java mostly on-and-off. I would do it for a month or so then pick up 6 - 8 weeks later... anyway, my point is I know the basics of Java quite well. This is because every time I jumped back into java, I would always recap from the beginning.

I understand I know hardly anything. That being said I really want to learn more about the language and get better at it. I am tired of doing System.out.Print() statements, I feel like I have done almost everything I can do with them. I have also done basic work with GridLayouts and Swing.

Since school is out I have been doing a lot of Java, at least a few hours a day. I have been following along with these tutorials.


The first 3 or so tutorials I completely understand, but after that it gets a bit difficult.

I am not here to ask a specific question about code. But I would like to know the opinion of an experienced Java programmer. Am I approaching this the correct way? What is the best way to learn the most Java? I feel like it's gotten to the point in the tutorials where I am not befitting from them like I was in the beginning.

Should I stick with what I am doing? Attempt to memorize the code? Could someone point me to somewhere else that I could learn?

I have never taken a class on programming, I will be a senior in high school.

share|improve this question

closed as primarily opinion-based by gnat, Jalayn, m3th0dman, World Engineer Jul 18 '13 at 20:06

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

The right way to learn Java is whatever way works best for you. If the tutorial is not working, try something else. I usually learn a programming language by alternating between reading a book and writing code. –  Patricia Shanahan Jul 14 '13 at 4:55
It seems you want to do game development with Java. Right? Because there often is a noteworthy difference between that and application development you should say so. –  Andy Jul 14 '13 at 6:36
yes, I am interested in game development. –  Steven Jul 14 '13 at 6:42
and advice to a beginner? :P –  Steven Jul 14 '13 at 6:42
You please read 'Head first java' book;it is really good for beginners. –  basha Jul 15 '13 at 4:35
show 1 more comment

7 Answers

I personally do not use Java as my language of choice (I prefer C#), but I will give my two cents.

I haven't had a lot of academic experience programming...I'm still working on my degree. However, I have had to learn a few different programming languages for the various jobs I have worked. I've found, at least for me, the main issue is maintaining interest and applying various things in the language:

  • Don't memorize the code, re-write it yourself in your own way. If the concept is particularly difficult, try doing what they did and then do little things like "hmm, what if I were to this" and see if you can get it to do interesting things.
  • Make a "project". Now, I don't mean project like IDE project, but something that you have a goal in mind and decide to build it. For example, when I was first learning PHP, I made like 4 or 5 forum systems. When I was messing with game structure, I did the same project (tetris) in 3 different languages. Tutorials work for learning, but sometimes it boxes you in a bit.
  • Find something interesting to do with the language. If mobile stuff tickles your fancy, write an app for your phone in Java. If you like games and are interested in that, try making tetris or pong or something. The key here is to try something really simple at first.
  • Google is your friend. If you can't figure out something from one tutorial, find a different one.
  • If you don't understand the "why" behind something works, try looking at multiple places that show it in action.
  • As for memorization, I've ended up just referencing documentation a lot to remember function names and stuff. So long as you remember what it can do and vaguely how to do it, you can get by looking up documentation for exact names until you have done the thing enough that you can remember it. For me, repetition and re-application of things helped a lot.

I've honestly found game development to be a hard starting point, but that's mainly because I can't draw and I would focus too much on making it look nice rather than making it work nice.

share|improve this answer
Yeah, I know game development is a popular aspiration, but as someone who has come much of the way myself, you will really need to accept that "Learning programming" and "Learning game programming" are two layered concepts that are very dependent. It's going to be painful to try to figure out class inheritance midway through writing your main game loop. –  Katana314 Jul 18 '13 at 13:29
The advantage of a game project is that it is something that can inspire you. The difficulty with a game project is it is often way more than person can chew (especially learning) and can discourage you. –  MichaelT Jul 18 '13 at 20:23
add comment

You are not approaching learning Java correctly.

You are trying to learn a language by doing a tutorial for writing 2D games. How about that ?

Java is not split into basic Java, intermediate Java and advanced Java.

You have to learn Java SE (SE stands for Standard Edition), which is the language with its core API (Math, Collections, I/O streams, Files, etc). You need to know how to work with arrays, collections, write to files and read to files, write to and read from keyboard, learn how to debug, etc. You should also learn how to manage a Java project using some IDE as well as compile classes from the command line for the sake of completeness.

There are a lots of resources in the internet for learning Java SE ( again meaning the bare language with its core API.

As Java is purely object oriented, you will have to learn object oriented programming concepts.

Once you know JSE fairly well and have a working knowledge of the API and how to read SE API documentation, then you can decide to learn some of the following:

  • J2EE ( web programming, JSP, servlets, web services, etc. )
  • GUI programming ( Swing, AWT, etc)
  • JDBC ( for reading and writing databases )
  • 2D, 3D
  • some frameworks for persistence, dependency injection etc. Although you can do well without them.
share|improve this answer
add comment

Although everyone has their own way of grasping things, I find learning from book very effective, while some of my friends learn from lectures first and then books/tutorials. So first thing is to find yourself how you learn best- by books or by attending lectures. One of the best books I found was Head First Java. Whether you learn from some book or from tutorials/lectures, make sure you code for the topics you are learning.

Also you might be facing difficulty (as did I and many others) in some topics because some of the topics require knowledge of other domains too rather than only programming. For example, threads should firstly be learnt with respect to subject Operating System rather than trying to learn coding for them directly. You'll only waste time if you don't study theory/basics of such topics first. Also all books and tutorial can have some topics badly/improperly covered. So try to learn each topic from more than one book/tutorial.

And for your question of taking classes, Its not that programming (or some other thing) can only be learnt by attending lectures. But different people grasp things different way. As I said earlier- some learn well from book while others learn well from lectures. If you have learnt this much on your own, you can definitely learn rest yourself.

share|improve this answer
add comment

In my experience learning how to program, and learning different languages, I've stumbled through two "traps" that are bad for learning a language:

  1. You do examples, tutorials, or book exercises that are trivial. However, the examples are too easy/trivial for you to care about; thus, you quickly become bored with programming and the language.
  2. You do a project in your language of choice, but almost as soon as you start, you're neck deep in topics you know nothing about.

It seems you're falling into trap #2 by starting with java 2D games, as you said you feel like the tuts have stopped helping you. The optimal way to approach learning java (or any language really) is something like this:

  1. Choose a project/problem that's just interesting enough so that you're not completely bored completing it, but is just hard enough to make you learn 1-3 new difficult topics along the way.
  2. Complete that which was chosen in step 1.
  3. Repeat.

After you iterate over the above steps more than 20 times, you'll likely be able to complete a project that is genuinely interesting. The problem is that when you're new to programming, you don't always know what topics you should be learning first, and you don't always know what skills you'll need to complete a given project/problem. This is where courses/books come in handy: they give you project ideas and/or a sequence in which to learn components of a particular language. With this in mind, here are some free courses with labs/problem sets (which I've completed) that are excellent in helping you advance your skills:

  • Data Structures in Java :: A java course which teaches data structures and has some pretty interesting labs that will help you build your java mastery.
  • Intro to Computer Science :: Taught mainly in C and PHP, this course focuses on skills which are language-agnostic: algorithms, data structures, best practices, etc. These problem sets were awesome for stretching my skills when I was new to programming.

Finally, make sure that your programming time is focused on programming (i.e. don't have social media on in the background or watch TV while programming).

p.s. It is possible to learn a language by picking a really difficult project from the start and completing it. The problem is that most people whom I've seen do this don't end up following through and completing the projects, because it takes much longer to see results if the project is really hard. This is why I suggest picking projects that are just a little harder than what you're currently capable of.

share|improve this answer
add comment

I am actually pretty new to Programming in general, I started with php, it's not c++ or anything but it works for what I needed which was a social networking site, pretty big for someone who knew nothing about coding not even how to write html, lol. Anyways when I started out in the very beginning, the thing that made me somewhat dread learning it was thinking that I needed to memorize everything. Since then I learned that your never going to remember everything, especially if you move from one to multiple languages, so instead learn how to use the language, the syntax and basically how it works, this involves just writing ALOT of your own code. Then you can pretty much do anything you want by just referencing useful functions or creating them if they don't exist and ways of doing certain things, over time I eventually just sorta remember the functions I use a lot. Learning the basics of programming in general help to move across languages too since many share a lot of commonalities.

The biggest thing I can say though is like me, get an idea for something specific you want to do and then go for it. You will learn how to get there eventually through LOTS of testing and reading tutorials.

Basically follow everything Los Frijoles said, he pretty much summed up everything I said in a neat way, lol.

share|improve this answer
add comment

I myself am getting back into java programming and had a bit of issues with the learning, the method that i am using to expand my knowledge is pick your project, what is it you want to make. once you have that start the break down. in order to make this i will need to do these, and keep breaking it down until you have a start point, and then once you have that point, you start to make your program learning what you have to create what you want to create.

Its working for me, so i hope this helps you!

share|improve this answer
add comment

There are some programmers who best learn to program thru books by studying systematically and scientifically how to program, while others prefer to learn the bare bones of developing software and excell thru trial & error. It's relative to the programmer which method is best.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.