[Solved] why this class not compiling? [duplicate]


Create Class With Same Package

public class Hello {

    public void print(){

        int a = 10;
        System.out.println("Number is :" +a);
    }
}

Crate Class to Set the Main Method Within the Same Package of Hello Method

public class Main {
    public static void main(String args[]){

        Hello h1 =  new Hello();
        h1.print();
    }
}

solved why this class not compiling? [duplicate]