To Documents
A JAVA TO VISUAL BASIC DICTIONARY
A Java expression is on the left with its corresponding
Visual Basic expression on the right.
-- Case Sensitivity
Java is case Visual Basic is not
sensitive. case sensitive.
-- Screen Output
System.out.println(x); System.Console.WriteLine(x)
System.out.print(x); System.Console.Write(x)
-- Datatype Names
byte Byte
short Short
int Integer
long Long
float Float
double Double
char Char
String String
boolean Boolean
-- Constants
34 34
-34.534 -34.534
'a' "a"c
"apple" "apple"
false False
true True
-- Conversion to Another Datatype.
n is an integer, x is a double, s is a String.
x = (double) n; x = CType(n, Double)
x = Double.parseDouble(s); x = CType(s, Double)
n = (int) x; n = CType(x, Integer)
n = Integer.parseInt(s); n = CType(x, Integer)
s = String.valueOf(n); s = CType(n, String)
s = String.valueOf(x); s = CType(x, String)
-- Operators
Assignment Operators
= =+ =- =* =/ = =+ =- =* =/ &=
Arithmetic Operators
+ - * / % + - * / Mod
Concatenation Operator
+ &
Comparison Operators
== != < <= > >= = <> < <= > >=
Logical Operators
&& || ~ And Or Not
String Comparison
s.equals(t) s = t
!s.equals(t) s != t
-- Control Flow
If..Else Statements
if (condition1) If condition1 Then
{ action1
action1; ElseIf condition1 Then
} action2
else if (condition2) ElseIf condition3 Then
{ action3
action2; Else
} defaultAction
else if (condition3) End If
{
action3;
}
else
{
defaultAction;
}
while (condition) While condition
{ action
action End While
}
for (i = 0; i < n; i++) For i = 0 To n
{ action
action Next
}