Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Web Hosting

Bonsai Boy of New York Bonsai Trees and Accessories

BlueHost Web Hosting

Liquid Web iThemes WordPress Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting

getResponse autofunnels

Liquid Web Cloud VPS Hosting

11,159 questions

15,235 answers

573 users

How to return single line ternary operator (if shorthand) from function in VB.NET

1 Answer

0 votes
Public Class Program 
    Public Shared Function mymax(a As Integer, b As Integer) As Integer
        return If (a > b, a, b)
    End Function
    Public Shared Sub Main()
        Console.WriteLine(mymax(23, 95)) 
        Console.WriteLine(mymax(mymax(23, 95), 100)) 
    End Sub
End Class

' run:

' 95
' 100


answered Jun 7 by avibootz