currently my file is run by me calling Java Server and then entering a port number after the program has started like this:
java Server
Port #:
I do this by creating a scanner in my main and just printing the prompt and waiting for input. and I can enter 7777 to set the port to 7777.
but how do I make it so I can just enter the port number like this?
java Server 7777
I tried it on my current code but the number entered after server just doesn't do anything and I'll still have to enter it into the prompt after.
void main(String[] args)? The command-line arguments are provided in that array it receives as its parameter.