So basically I'm doing a server and client in java.
In order for it to run, I have to run both a client.java and server.java. I need to close one or both depending on the instance
What I currently need is a way such that when the client passes a parameter x, the client should close but the server should remain open. I also have to implement it in such a way that if client passes parameter y instead, both the client and server should close
I thought of doing:
System.exit(0);
But I'm not sure if this would close both server and client, meaning that it would be useful for the second instance. I also thought of just letting it reach the end of the program, but I'm not really sure what result would be the result of that.