class test_math
{
int sum(int a,int b)
{
System.out.print("\nHits on Integer function\n");
return(a+b);
}
float sum(float a,float b)
{
System.out.print("\nHits on Float function\n");
return(a+b);
}
}
public class Test
{
public static void main(String args[])
{
test_math t=new test_math();
System.out.println(t.sum(2.5f,3.5f));
System.out.println(t.sum(2,3));
System.out.println(t.sum(2,3.9f));
}
}
Comments
Post a Comment