sample code method overloading with implicit casting
package oops;
public class OverloadingImplicitCasting {
public void m1(double d)
{
System.out.println(" double arg");
}
public static void main(String a[])
{
OverloadingImplicitCasting s=new OverloadingImplicitCasting();
s.m1(10); //int
s.m1(10.5); // double
s.m1('a'); // char
}
}
0 comments:
Post a Comment