Why doesn't my code compile?
Here's the code:
public class Exceptions
{
public void method1(int x)
{
if (x < 0)
throw new Exception("ERROR: Negative value in X coordinate.");
Type: Posts; User: Bao
Why doesn't my code compile?
Here's the code:
public class Exceptions
{
public void method1(int x)
{
if (x < 0)
throw new Exception("ERROR: Negative value in X coordinate.");
Sorry, I updated it
--- Update ---
I figured it out guys, I forgot to assign the "line" variable to the "reader.readLine()" method.
I’m doing this exercise where I need to design a program that will generate a random number between 1 and 100 and then let the user guess the number and tell them whether the guess is too high or too...