That's all I have in my code right now and I'm getting an error on line 3 that reads "integer number too large: 600851475143." It was to my understanding that a long variable can store numbers way bigger than that. What am I doing wrong here?
Yes, a long can hold any number that can be put into an int. But by default, numbers in Java are int and 600851475143 will not fit into an int. Try adding an 'L' to the number, which tells the compiler it is a long: