Method overloading in Java
<pre><code>import java.lang.Math;
class Squr
{
  public static void main ()
  { 

   Squr square = new Squr();
   System.out.println ("square root of 10 : " + square.mysqrt(10));
   System.out.println (" Square root of 10.4 : "+ square.mysqrt(10.4)); 

  }

  int mysqrt ( int x)
   {
     return Math.sqrt(x);
   }
  double mysqrt (double y)
   {
     return Math.sqrt(y);
   }
}
</code></pre>

<p>When we compile it then it's giving error "possible loss of precision"
found :double
required :int</p>

<p>I have written this program for calculating square root of integer or double type values by method overloading concept..</p>
