| OLD | NEW |
| 1 <section> | 1 <section> |
| 2 <p> | 2 <p> |
| 3 <em>Interfaces</em>—types that define | 3 <em>Interfaces</em>—types that define |
| 4 which methods a class provides—are | 4 which methods a class provides—are |
| 5 important in Dart. | 5 important in Dart. |
| 6 In fact, much of the Dart | 6 In fact, much of the Dart |
| 7 <a href="http://api.dartlang.org/dart_core/" target="_blank">Core Library</a> | 7 <a href="http://api.dartlang.org/dart_core/" target="_blank">Core Library</a> |
| 8 is defined in terms of interfaces. | 8 is defined in terms of interfaces. |
| 9 If you've never used a language | 9 If you've never used a language |
| 10 that features interfaces or protocols, | 10 that features interfaces or protocols, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 <dt> <code>int</code> and <code>num</code> interfaces </dt> | 63 <dt> <code>int</code> and <code>num</code> interfaces </dt> |
| 64 <dd> | 64 <dd> |
| 65 Although you might expect <code>int</code> and <code>double</code> | 65 Although you might expect <code>int</code> and <code>double</code> |
| 66 to be primitive types, | 66 to be primitive types, |
| 67 they're actually interfaces that | 67 they're actually interfaces that |
| 68 extend the <code>num</code> interface. | 68 extend the <code>num</code> interface. |
| 69 This means that <code>int</code> and <code>double</code> variables | 69 This means that <code>int</code> and <code>double</code> variables |
| 70 are also <code>num</code>s. | 70 are also <code>num</code>s. |
| 71 | 71 |
| 72 <aside class="note"> | 72 <aside> |
| 73 <b>Important:</b> | 73 <div class="alert alert-info"> |
| 74 <strong>Tip:</strong> |
| 74 Be sure to initialize numbers. | 75 Be sure to initialize numbers. |
| 75 Because they're objects, | 76 Because they're objects, |
| 76 their initial value is <code>null</code>, | 77 their initial value is <code>null</code>, |
| 77 not 0. | 78 not 0. |
| 79 </div> |
| 78 </aside> | 80 </aside> |
| 79 | 81 |
| 80 <p> | 82 <p> |
| 81 In use, <code>int</code> and <code>double</code> | 83 In use, <code>int</code> and <code>double</code> |
| 82 feel like the primitive types you're probably used to. | 84 feel like the primitive types you're probably used to. |
| 83 For example, you can use literals to set their values: | 85 For example, you can use literals to set their values: |
| 84 </p> | 86 </p> |
| 85 | 87 |
| 86 <pre>int height = 160; | 88 <pre>int height = 160; |
| 87 double rad = 0.0;</pre> | 89 double rad = 0.0;</pre> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 111 <h3> Try this </h3> | 113 <h3> Try this </h3> |
| 112 | 114 |
| 113 {PENDING: add stuff if we think of anything} | 115 {PENDING: add stuff if we think of anything} |
| 114 | 116 |
| 115 </section> | 117 </section> |
| 116 {% endcomment %} | 118 {% endcomment %} |
| 117 | 119 |
| 118 | 120 |
| 119 </div> | 121 </div> |
| 120 </section> | 122 </section> |
| OLD | NEW |