Well I would start by analyzing what states lock has, like whether the lock is open or not, the numbers in the combination, what place in the combination we are at. I would put all that information at the top of the class. like this
Then in your constructor your going to have to assign values to some variables you want initialized in the lock class when it is constructed. For example:
lastly your going to have to implement the logic. Look at how the lock steps through it combination and replicate those steps in the programing. Id recommend using a switch statement and using a int variable to keep track of the part of the combination we are in. An example switch statement is presented below.
at any rate
http://java.sun.com/docs/books/tutorial/ has lots of basic information about the java language and should help you if you get stuck on what to type in for code or need help understanding the syntax and how to use it.