I've noticed today that for keyboard input moving lets say a g.drawRect() on JFrame, there are many ways of using the key class to do this?
1. How many ways from the top of your head do you think you could do this? (This will also help me on the research side to programming in java)
Also, 2. How should I start out with programming a small game like pong/breakout, would it be best if I just stick to making it in one class first?
If someone could answer these 2 questions especially the 1st one that'd be excellent personally.
Okay, seems to me that you are fairly new to programming, so I'm going to try to put some perspective on coding.
Creating a game is more like drawing, or planting a seed. So, when you ask "how many different ways can you code?" You are asking "how many ways a plant can grow?", or "how many ways you can draw a tree?" You know the answer is a number, but you can't say what it is. It is something we can't measure. There are numerous different ways to write "Pong". A programmer can write it in 100 lines of code all the way 5000000 lines of code and more if they wanted to. The fact is it all depends on who you ask, and how good of a programmer the person is. There are as many ways to write a program as there are stars in the universe.
As for writing programs themselves. You always start simple. You write things in one class and expand outward from there.
You can learn functions by just seeing how you can remove some code from your "main" class to make a function. When you code, the main idea is to make doing repetitive tasks easier. That is what computers were designed for. When you code, you are doing the same thing. Classes and functions are made to prevent you from having to repeat the same lines of code 40 times. The moment you are repeating code, that is when you know it is time to start using those functions.
The best way to learn how to program is to practice at it. There is a lot of information on the forums here and elsewhere on how to program. I hope this little segment broadens what programming is to you a little more.