Detect if there is any syntax or runtime error for each stat
Solution
SOLUTION
public class Person {
   
    private String name;//valid
    int value;//valid
    //valid
    public Person(int x) {
        value=x;
    }
   
}
Test class
public class Test {
    public static void main(String[] arg) {
        int[] x = { 1, 2, 3, 4 };// valid
       // you have to initialize the local variables
        // local variables means the members/variables which are declared within
        // the method,blocks,loops etc....
        int y, z;// compile time error(you are not get any compile time error
                    // but if you want to access y or z without initializing you
                    // will get compile time error)
x[0] = 1;// valid
       // this is compile time error cannot convert double to int
        y = 1.0;
       // if we don\'t provide any constructor compiler creates a default
        // constructor
        // if we write parameter constructor in our class compiler ignores to
        // create no-org
        // constructor in this case we get a compile time error must and should
        // pass value while creating constructor
Person p = new Person();// compile time
       // valid statement
        Person p1 = new Person(10);
       // we cannot access private members outside the class
        // if you want access the private members outside of the class must use
        // setters and getters
        // in this case change visibility to default or other modifiers
        p1.name = \"Austin\";// compile time error
p1.y = 10;// compile time error (y cannot be resolved or not a field)
       z = 3 / 0;// you are going to get runtime exception
                    // exception in thread main:ArithmeticException
       x[5] = 1;// you are going to get runtime exception
                    // Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException
    }
}


