title: Asking About Using Variable in Kotlin
body: <p>I am new to programming and currently trying to learn how to build an application by using Kotlin. I just want to ask should I declare variable outside of the main activity class and then access it in another activity. For example, in the following code:</p>
  <pre><code>   var post: ArrayList&lt;Model&gt; = ArrayList()
     class MainActivity : AppCompatActivity() { 
      }
  </code></pre>
  <p>I declare the post ArrayList outside of the mainActivity and then in my second Activity, I can access it without using any technique to pass and receive data. I have never seen any instruction to do that way and wonder why it should not be done.
  Sorry if my question is stupid.</p>