You can do this by making an instance of a variable/class in your main class and passing it to your tasks. If you change anything on the passed object in a task, its values will also 'sync' in the main as the object has the same pointer, you're referring to the same object.
That being said, look into OOP principles as this is basic stuff.