title: Debugging Java in Visual Studio Code Compilation Error
body: <p>I'm trying to debug a simple Java program using the Java Extension Pack in VS code. I am pretty new to Java programming and I read up on Writing Java in VS code <a href="https://code.visualstudio.com/docs/java/java-tutorial" rel="nofollow noreferrer">https://code.visualstudio.com/docs/java/java-tutorial</a> to understand how to debug Java code. I am able to run the code but when I have my class BicycleDemo as public not package(default) access modifier I have an "Exception in thread "main" java.lang.Error: Unresolved compilation problem:"</p>
  
  <p>If I have my class BicycleDemo without the public keyword it works fine. Why is this?</p>
  
  <pre><code>class Bicycle {
      int cadence = 0;
      int speed = 0;
      int gear = 1;
  
      void changeCadence(int newValue) { cadence = newValue; }
      void changeGear(int newValue) { gear = newValue; }
      void speedUp(int increment) { speed = speed + increment; }
      void applyBrakes(int decrement) { speed = speed - decrement; }
      void printStates() {
      System.out.println("cadence:" + cadence + " speed:" + speed + " gear:" + gear);
      }
  }
  
  public class BicycleDemo {
  public static void main(String[] args) {
      // Create two different Bicycle objects
      Bicycle bike1 = new Bicycle();
      Bicycle bike2 = new Bicycle();
      // Invoke methods on those objects
      bike1.changeCadence(50);
      bike1.speedUp(10);
      bike1.changeGear(2);
      bike1.printStates();
      bike2.changeCadence(50);
      bike2.speedUp(10);
      bike2.changeGear(2);
      bike2.changeCadence(40);
      bike2.speedUp(10);
      bike2.changeGear(3);
      bike2.printStates();
      }
  }
  </code></pre>