Using a fixed frame rate is the easiest approach, and I definitely recommend it for beginners. It simplifies the game logic (you just write x+=vx, not x+=deltaTime*vx), and it guarantees that the game’s behaviour is the same on all machines (which can be important if you’re doing any physics-type simulations).
The drawbacks are that your game can’t increase its frame rate to take advantage of more powerful hardware (I think that’s a very minor issue in practice; some people get very worked up about it though), and that the game will get jerky if the game loop struggles to maintain the frame rate for some reason (which is annoying, but forgivable for beginner projects).
Unfortunately, no one can agree on the best code for a fixed frame rate game loop in Java. :
Search the forums and you’ll find a lot of discussions. Just pick a bit of code (like the game loop below) and don’t worry about it too much.
That game loop runs (or attempts to run) at a fixed rate of 60 frames per second.
The reason why (as ra4king says) that game loop supplies the value of deltaTime to its update method is so that developer has the option of writing variable frame rate-style code in case the frame rate becomes erratic. But you’re free to completely ignore the value.
The deltaTime in that code is the measured time since the last frame. Ideally it will always be close to 17 (one 60th of a second in milliseconds), but that can’t be guaranteed. If you like, try printing out the value to see how reliable it is.
As I’ve said, in practice you can just ignore deltaTime and carry on making your game.
Simon