Psychology homework help. 4 DoorLockCreate an implementation for the class DoorLock described below.declare an integer constant, calledMAX_NUMBER_OF_ATTEMPTS, that you will initialize to the value 3; instance variables. The classDoorLockmust have the necessary instance variables toi)store an object of the classCombination,ii)to represent the property of being opened or closed,iii)to represent its activation state (the door lock is activated or deactivated), andiv)to count the number of unsuccessful attempts at opening the door; the class has a single constructor,DoorLock( Combination combination ), which initializes this instance with a combination. When a door lock is first created, the door lock is closed. Also, when the object is first created, it is activated and the number of failed attempts at opening it should be zero; implement the instance methodpublic boolean isOpen()that returnstrueif this door lock is currently opened andfalseotherwise; implement the instance methodpublic boolean isActivated()that returnstrueif this door lock is currently activated andfalseotherwise. implement the instance methodpublic void activate( Combination c )that sets the instance variable activated totrueif the parametercis equals to the combination of this object; finally, implement the instance methodpublic boolean open( Combination combination )such thati)an attempt is made at opening this door lock only if this door lock is activated,ii)if the parameter combination is equals to the combination of this door lock, set the state of the door to be open, and the number of failed attempts should be reset to zero,ii)otherwise, i.e. if the wrongCombinationwas supplied, the number of failed attempts should be incremented by one,iii)if the number of failed attempts reachesMAX_NUMBER_OF_ATTEMPTS, this door lock should be deactivated.Hint: my implementation is approximately 40 lines long, not counting the blank lines.