title: One to one relationships in UML diagrams
body: <p>I am new to UML diagrams and reading a book about it. There it has a class diagram like the following:</p>
  
  <p><img src="https://i.stack.imgur.com/RMhpi.jpg" alt="enter image description here"></p>
  
  <p>And it says that, </p>
  
  <pre><code>The implication of a one to one association is that whenever you create an 
  instance of one of the classes, you must simultaneously create an instance 
  of the other, and when you delete one you must delete the other.
  </code></pre>
  
  <p>My question is, do we really have to do this? Can't we give "null" as a value to one of these? For example, i am thinking of the java code of this diagram like the following, and when i want to create a Company item, i can give null as the parameter. Am i wrong? Or is this a bad or wrong piece of code?</p>
  
  <pre><code>public class Company{
         . . .
      private BoardOfDirectors director;
      public Company(BoardOfDirectors director){
            this.director=director;
  
      }
         . . .
  }
  
  public class BoardOfDirectors{
         . . .
     private Company company;
     public BoardOfDirectors(Company company){
            this.company=company;
  
     }
         . . .
  }
  </code></pre>
  
  <p>Thank you.</p>