How to Update a module's weight?

In drupal, the order in which a module's hooks get called is dependent on the weight of your module in the system table.

1)  we can change the weight with a query
     UPDATE system SET weight = 999 WHERE name = 'Module name'

2) hook_module_implements_alter()

3) code to update
    function modulename_install() {
     db_update('system')->fields(array('weight'=>999))->condition('name', 'modulename', '=')->execute();

4) Changing moduleweight via UI
   => modules_weight & Util - Contrib module