Can I assign a object to a integer variable?
<p>Let say I have a object. I'm assigning that to an integer. </p>

<pre><code>MyClass obj1 = 100;//Not valid
</code></pre>

<p>Let's say, I have a parameterized constructor which accepts an integer.</p>

<pre><code>MyClass(int Num)
{
    // .. do whatever..
}

MyClass obj1 = 100;//Now, its valid
</code></pre>

<p>Likewise on any circumstance, does the vice-versa becomes valid?!.</p>

<pre><code>eg) int Number = obj1;//Is it VALID or can be made valid by some tweeks
</code></pre>

<p><strong>EDIT</strong>:</p>

<p>I found this to be possible using <em>Conversion Functions.</em> 
Conversion functions are often called "cast operators" because they (along with constructors) are the functions called when a cast is used.</p>

<p>Conversion functions use the following syntax:</p>

<blockquote>
  <p>operator conversion-type-name ()</p>
</blockquote>

<p>eg) Many have explained it neatly below</p>
