There are no pointers in Java, only references.
You cannot reassign a reference when you pass them to methods, because you pass them by value. Everything is passed by value in Java.
You can rewrite this method to instantiate a new instance of the device and return that instead of an int.