.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Simple Overloading Concept

Posted By:NATHAN ISRAEL       Posted Date: September 21, 2012    Points: 40    Category: OOPS    URL: http://www.dotnetspark.com  

Simple Overloading Concept Using OOPS
 

class Poly
{
    int volume(int s)
    {
        return(s*s*s);
    }

    double volume(double r,int h)
    {
        return(3.14*r*r*h);
    }
   
}
class Method_Overloading
{
        public static void main(String args[])
    {
        Poly po = new Poly();
        po.volume(5);
        po.volume(2.2,5);
        System.out.println("Method Overloading");
        
    }
}

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend