Elementary Java/OOP uncertainties on fields and instances of a class
<p>In a class, you can create fields within them, as int bar in the following example.</p>

<pre><code>Class foo{
    int bar;
    foo(int bar){
         bar = bar;
    }

    int getBar() {
         return bar;
    }   

    void setBar(int bar) {
         bar = bar;
    }
}
</code></pre>

<ol>
<li><p>Every time I create a new foo object in another class, will that particular object (instance of foo) have a bar property that when changed with the setBar(), only impacts that instance and no other instances? </p></li>
<li><p>I often see people create getters and setters for properties like bar in the above example. If I feel lazy and I'm just writing code for myself/fun, can I just modify the bar property of any instance of this class by accessing the property <code>FooInstance1.bar = 22;</code> instead of having to write a setter and it will have the same effect as in question 1 (just the instance is changed)?</p></li>
<li><p>How does the Java compiler know what method is a constructor? By the fact that it has the same name as the class? Or by the fact that one does not specify a return value in the function header? Perhaps it doesn't even matter what the compiler thinks is a constructor (no syntactic difference between regular function), it could be just a semantic thing that people use to differentiate the meaning of functions. </p></li>
</ol>

<p>EDIT: I'm having a hard time selecting a best answer. I learned something new from everyone. Thanks!</p>
