If you haven't yet, you probably will soon, learn try/catch logic. InputMismatchException is being thrown because your feeding an int variable something that is not a int. That goes for any kind of...
Type: Posts; User: Chromejuice
If you haven't yet, you probably will soon, learn try/catch logic. InputMismatchException is being thrown because your feeding an int variable something that is not a int. That goes for any kind of...
Will take that into account! I finally understood what the bug was... I made the Scanner static so I believe every thread was sharing the same Scanner.
Nvm error has been resolved from using magical logic. Somehow my teachers identical code manages to run it flawlessly... : /
package chatprogram;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import...
Homework assignment to make a simple client/server program in which the user has commands to ask for the line of a text file, ask for a random line, count how many lines, and leave the server.
So...
public class GiveMe10 {
enum GiveTen {one, two, three, four, five, six, seven, eight, nine, ten};
public static void main(String[] args) {
GiveTen[] num = GiveTen.values();
for (int i = 0;...