title: How to restrict access to nested class member to enclosing class?
body: <p>Is it possible to specify that members of a nested class can be accessed by the enclosing class, but not other classes ?</p>
  
  <p>Here's an illustration of the problem (of course my actual code is a bit more complex...) :</p>
  
  <pre><code>public class Journal
  {
      public class JournalEntry
      {
          public JournalEntry(object value)
          {
              this.Timestamp = DateTime.Now;
              this.Value = value;
          }
  
          public DateTime Timestamp { get; private set; }
          public object Value { get; private set; }
      }
  
      // ...
  }
  </code></pre>
  
  <p>I would like to prevent client code from creating instances of <code>JournalEntry</code>, but <code>Journal</code> must be able to create them. If I make the constructor public, anyone can create instances... but if I make it private, <code>Journal</code> won't be able to !</p>
  
  <p>Note that the <code>JournalEntry</code> class must be public, because I want to be able to expose existing entries to client code.</p>
  
  <p>Any suggestion would be appreciated !</p>
  
  <hr>
  
  <p>UPDATE: Thanks everyone for your input, I eventually went for the public <code>IJournalEntry</code> interface, implemented by a private <code>JournalEntry</code> class (despite the last requirement in my question...)</p>