Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Method overLoading In Objective C

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 462
    Comment on it

    **

    Method overLoading In Objective C:

    ** method overloading concept in object oriented language we use the same method name with the different signature. Signature is the argument that we send using the function. we just change the number of argument in the method calling and which method have the same number of argument from calling function then that method is called.

    @interface Person : NSObject
    -(void) showNumber:(double)x
    {
    NSLog(@"Hello First mehod value==%f",x);
    }
    -(void)showNumber:(double)x and:(int)y{
    NSLog(@"Method overLoaded value==%f and second value=%d",x,y);
    }
    @end
    int main(void) {    
     Person *perObj = [Person new];     
     [perObj showNumber:5.0f];    
     [perObj showNumber:5.0f and:10]; 
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: