monitor a file using thread concept java code example Example: java execute funtions at same time new Thread(() -> [YOUR METHOD]()).start();