title: Cannot access class in java
body: <p>I am trying to create a class to send information on the day of the week. For some reason when I try to include the class I get an error saying:</p>
  <pre><code>CreateCalendarVisuals.java:1: error: cannot access FindDateFindTime
  import FindDateFindTime.FindDateFindTime;
                         ^
    bad class file: .\FindDateFindTime\FindDateFindTime.class
      class file contains wrong class: FindDateFindTime
      Please remove or make sure it appears in the correct subdirectory of the classpath.
  </code></pre>
  <p>I have creat this code to find the date/time:</p>
  <pre><code>import java.time.LocalDate;
  import java.time.DayOfWeek;
  import java.time.LocalTime;
  
  public class FindDateFindTime
  {
  // public static void main(String[] args)
  // {
  //         LocalDate date = LocalDate.now();
  //         LocalTime time = LocalTime.now();
  //
  //         System.out.println(&quot;Date: &quot; + date + &quot;; Time: &quot; + time);
  // }
  
  public int dayOfWeek(int year, int month, int day)
  {
          LocalDate date = LocalDate.of(year, month, day);
  
          DayOfWeek d = date.getDayOfWeek();
          return d.getValue();
  }
  }
  </code></pre>
  <p>the class is public so I don't know why it would say that it cannot access. I am trying to call that class with this code:</p>
  <pre><code>import FindDateFindTime.FindDateFindTime;
  
  public class CreateCalendarVisuals
  {
  public static void main(String[] args)
  {
          FindDateFindTime d = new FindDateFindTime();
           System.out.println(d.dayOfWeek(2021, 04, 24));
  }
  }
  </code></pre>
  <p>My FindDateFindTime class is in a folder with the same name so I am that is why I have &quot;import FindDateFindTime.FindDateFindTime&quot;. I have tried to look this up but I can't seem to find any solutions. I have also tried to do this with a package but it gives me the same issue. Could someone please help, I honestly don't know what to do.</p>