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.

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 some game tutorials. The first three 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?

share

locked by World Engineer Nov 18 at 23:43

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

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.

3  
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
1  
You please read 'Head first java' book;it is really good for beginners. –  JAVA Jul 15 '13 at 4:35
1  
Try to think of a simple project. If you are interested in games then think which game. Keep it simple. Ask a question about the simplest architecture of this game. Do your research before asking the question. I think that wouldn't be put on hold if you ask it properly. After you get a basic architecture work on one part and ask specific questions about that. That should help things stick into your mind. Test it improve it, ask for code reviews on codereview.stackexchange and then move to second part. Find the best Java discussion forums and start using them. Immersion helps a lot. –  Aseem Bansal Jul 18 '13 at 21:21

4 Answers 4

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
    
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

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.)
  • Desktop GUI programming (Swing, AWT, etc)
  • JDBC (for reading and writing to databases)
  • 2D, 3D
  • some frameworks for persistence, dependency injection etc. Although you can do well without them.
share

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

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

protected by Community Nov 18 at 23:42

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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