title: What's the difference of `private` and `fileprivate` class in the same file in Swift?
body: <p>As the sample code here, what's the difference of <code>private</code> and <code>fileprivate</code> class in the same file in Swift?</p>
  <pre><code>//  ViewController.swift
  
  private class A {
      var name: String = &quot;&quot;
  
      let d = B.D()
  }
  
  fileprivate class B {
      var name: String = &quot;&quot;
  
      private let c = C()
      private class C {
          var number: String = &quot;&quot;
      }
  
      fileprivate let d = D()
      fileprivate class D {
          var number: String = &quot;&quot;
      }
  }
  </code></pre>
  <p>Since class A and B are in the sample file, A can't be any more private then B, right?</p>
  <p>Sorry this is a very picky question, but I just want to confirm it.</p>