This is just the difference in terms of the process exit code. Therefore, if something acts on the exit code (where 0 is usually successful, and a nonzero value usually indicates an error), you can control what they see.
As an example, take this tiny Java program that uses the number of command line arguments as the exit code:
public class Test { public static void main(String[] args) throws Exception { System.exit(args.length); } }
Now run it from the bash shell, where && means "execute the second command if the first is successful", we can:
~ $ java Test && echo Success! Success! ~ $ java Test boom && echo Success!
source share