• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

Java Equivalent to VB Loops

For Loop

VB.NET Java
For i As Integer = 1 To 9
Next i
for (int i = 1; i <= 9; i++)
{
}

For Each Loop

VB.NET Java
For Each s As String In StringList
Next s
for (String s : StringList)
{
}

While Loop

VB.NET Java
Do While condition
Loop

or:

While condition
End While
while (condition)
{
}

Do While Loop

VB.NET Java
Do
Loop While condition
do
{
} while (condition)

Loop Until

VB.NET Java (no specific 'loop until' construct)
Do
Loop Until condition
do
{
} while ( ! condition)

Do Until

VB.NET Java (no specific 'do until' construct)
Do Until condition
Loop
while ( ! condition)
{
}


Use VB to Java Converter to convert from VB.NET to Java.     

Additional resource: VB.NET and Java Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.