beingtopper.jkp@gmail.com
+91-8700702530
Free Demo

Being Topper

  • About Us
  • Knowledge Base
  • Modules
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • About Us
  • Knowledge Base
  • Modules
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • About Us
  • Knowledge Base
  • Modules
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • About Us
  • Knowledge Base
  • Modules
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
BCA NOTESVB.Net progrmas

WAP to demonstrate Polymorphism in Vb.net through Method Overloading

Being Topper 17/10/2014 0 Comments

 Demonstratation of  Polymorphism in Vb.net through Method Overloading :

code begins :

Imports System.Console

Module Module1

 

Sub areas(ByVal side As Integer)

Dim area As Integer

area = side * side

WriteLine("Area of Square : " & area)

End Sub

Sub areas(ByVal l As Integer,ByVal b As Integer)

Dim area As Integer

area = l * b

WriteLine("Area of Rectangle : " & area)

End Sub

Sub areas(ByVal r As Double)

Dim area As Double

area = 4.13 * r * r

WriteLine("Area of Circle : " & area)

End Sub

 

 

Sub Main()

Dim l, b, ch As Integer

Dim r As Double

WriteLine("1. Area of a Square")

WriteLine("2. Area of a Rectange")

WriteLine("3. Area of a Circle")

WriteLine("Enter Your Choice : ")

ch = ReadLine()

 

Select Case ch

Case 1

Write("Enter Size of a side : ")

l = ReadLine()

areas(l)

Case 2

Write("Enter length : ")

l = ReadLine()

Write("Enter breadth : ")

b = ReadLine()

areas(l, b)

Case 3

Write("Enter radius : ")

r = ReadLine()

areas(r)

 

Case Else

WriteLine("Enter a Valid Choice")

 

End Select

 

End Sub

 

End Module

Output

WAP to demonstrate Polymorphism in Vb.net through Method Overloading

method overloading polymerphism
AboutBeing Topper
In Socials:
PrevProgram to demonstrate abstract class and abstract methods in VB.net.17/10/2014
Demonstrate Polymorphism in Vb.net through Constructor overloading.17/10/2014Next
Categories
Recent Posts
  • Best Email Marketing Software and Services
  • How to Apply Adsense on YouTube
  • Complete Guide to Writing a Newsletter !
  • Benefits of Creating Email List for small Businesses | Digital Marketing
  • Create Account or Get Email Alerts When New Employees Join a Company

Copyright © 2021 Being Topper ® . All Rights Reserved