int x;
nothing nothing dim x%
assignment x=1;
x=1
x=1
x=1
Declare and assign values int x=1;
x=1
x=1
nothing empty null
None
null
undefined
Null
int x=1;
x=1
x=1
x=1
character char a='A';
nothing nothing nothing character string String a="A";
a="A"
a='A'
a="A"
a='A'
a="A"
decimal float f=3.14f;
double d=1.7d
f=3.14
f=3.14
f=3.14
Boolean boolean b=true;
b=True
b=true
b=True
Constant final double PI=3.14;
PI=3.14
const PI=3.14
Const PI=3.14
object StringBuilder sb = new StringBuilder();
var sb = new StringBuilder();
sb = ShaBi()
sb = new Shabi()
x = CreateObject("Scripting.Dictionary")
Type conversion Only upward conversions are allowed allow allow allow mod
The next power nothing 3**23**2 nothing Self increasing ++++ nothing nothing Self reduction ---- nothing nothing superposition +=+=+= nothing Reduplication -=-=-= nothing Multiplicative multiplication *=*=*= nothing Reduplication /=/=/= nothing Brackets ()()()() String connection ++++and
&&and
or||or
||or
not!not
!not
// Java
x = a > b ? c : d;
# Python
x = c if a > b else d
// JavaScript
x = a > b ? c : d
' VBA
if a > b Then x = c Else x = d
// Java
if (a > b) {
x = c;
} else {
x = d;
}
# Python
if a > b:
x = c
else:
x = d
// JavaScript
if (a > b) {
x = c
} else {
x = d
}
' VBA
If a > b Then
x = c
Else
x = d
End If
// Java
if (a > b) {
x = c;
} else if (a > bb) {
x = cc;
} else {
x = d;
}
# Python
if a > b:
x = c
elif a > bb:
x = cc
else:
x = d
// JavaScript
if (a > b) {
x = c
} else if (a > bb) {
x = cc
} else {
x = d
}
' VBA
If a > b Then
x = c
ElseIf a > bb Then
x = cc
Else
x = d
End If
// Java
for (int i=0;i<100;i++) {
System.out.println(i);
}
# Python
for i in range(100):
print(i)
// JavaScript
for (var i=0;i<100;i++) {
console.log(i)
}
' VBA
For i = 1 to 100 step 1
Debug.Print i
next
// Java
for (int a:arr) {
System.out.print(a);
}
# Python
for a in arr:
print(a)
// JavaScript
for (a in arr) {
console.log(a)
}
' VBA
For Each a in arr
Debug.Print a
Next
break
break
break
Exit For
Skip the loop continue
continue
continue
goto
// Java
int i;
while (i < 100) {
System.out.println(i);
i++;
}
// java Another while
int i;
do {
System.out.println(i);
i++;
} while (i < 99);
# Python
i = 0
while True:
if i < 100:
print(i)
else:
break
// JavaScript
i = 0
while (i < 100) {
console.log(i)
i++
}
' VBA
' 1
i = 0;
While i < 100
Debug.Print(i)
Wend
' VBA
' 2
i = 0;
Do While i < 100
Debug.Print(i)
Loop
' VBA
' 3
i = 0;
Do
Debug.Print(i)
Loop While i < 99
' VBA
' 4
i = 0;
Do Until i >= 100
Debug.Print(i)
Loop
' VBA
' 5
i = 0;
Do
Debug.Print(i)
Loop Until i >= 99
break
break
break
Exit Do
Skip the loop continue
continue
continue
goto
int[] x = {1,2,3,4,5};
x = [1,2,3,4,5]
x = [1,2,3,4,5]
dim Arr()
Symbol {}[]Array()
Indexes x[0];
x[0]
x[0]
Arr(0)
Type mix Don't allow x=[1,'a']
x=[1,'a']
Arr=Array(1,"a")
increase Don't allow x.append('b')
x.insert(0,'c')
x.push('b')
Redim Preserve Arr(4)
Arr(4) = 3
Delete Don't allow x.pop(1)
del x[1]
x.pop(1)
Redim Arr(1)
Change x[0] = 6;
x[0] = 6
x[0] = 6
Arr(0)=6
/** * Documentation Comments */
public class Hello {
public static void main(String[] args) {
// Main program description
userFunction usf = new userFunction();
usf.setArg("Hello");
System.out.println(usf.getArg());
/* Multiline comment branch */
}
}
class userFunction {
private String arg;
public void setArg(String arg) {
// Set up
this.arg = arg;
}
public String getArg() {
// return
return this.arg;
}
}
''' documentation '''
class userFunction:
def __init__(self):
pass
def setArg(self,arg):
self.arg = arg
def getArg(self):
return self.arg
if __name__ == '__main__':
usf = userFunction()
usf.setArg("Hello")
print(usf.getArg())
function userFunction(args) {
x = process(args)
return x
}
Sub userSub()
x = userFunction(args)
Debug.Print x
End Sub
Function userFunction(args) as String
userFunction = process(args)
End Function
System.out.println
System.out.print
print
console.log
Debug.Print
Format output System.out.printf
System.out.format
format
nothing nothing Quick format nothing f'{d} is a number'
`${d} is a number` nothing import java.util.Scanner
Scanner scanner = new Scanner(System.int);
String ipt = scanner.nextLine();
ipt = input(' Please enter :')
var ipt = prompt(' Please enter ',' Default ')
ipt = InputBox(" Please enter ",," Default ")
try {..}
catch {...}
finally {...}
try:
except:
finally:
try {..}
catch {...}
finally {...}
On error goto tag
I think it will be more efficient to learn new code according to the previous code
Beginners Java There are also many people who don't understand , If there is a mistake , Please correct
##############################
為什麼寫這篇文章我從2021年6月13號寫下第一篇Pytho