title: How to import class from other java file?
body: <p>I am trying to implement Stack which is in other java file named Stack.java where I have declared package p1;
  And I have imported it to file where I am going to use it.
  Whenever I try to run it gives me <strong>package does not exist error</strong>
  <a href="https://i.stack.imgur.com/XCwPp.jpg" rel="nofollow noreferrer">Here is my code</a></p>
  <p>I think my syntax is correct.
  But I am having trouble understanding how to compile a package and run a program using class present in package. I am using Windows Visual Studio Code on Windows OS. I am running the java program in windows terminal.</p>