C++ & Java - overloading operator
<p>I have a difficult to understand the subject of overloading operator in C++ and Java.</p>

<p>For example, I define a new class Fraction:</p>

<pre><code>class Fraction { 
public: 
    Fraction (int top, int bottom) { t = top; b = bottom; } 
    int numerator() { return t; } 
    int denominator() { return b; } 
private: 
    int t, b; 
};
</code></pre>

<p>and I want to overload the operator <code>&lt;&lt;</code> for printing Fraction. How I do it? I need to overload it inside Class Fraction or outside Class Fraction?</p>

<p>In java - Is it possible to overload operator? How I can do it there (for example, I want to overload the operator <code>+</code>).</p>

<p>If there is a metrial about this subject, It will be great.</p>
