|
C |
C# |
Javascript |
Java |
| Case sensitive |
Is |
Is |
Is |
Is |
| Statement end |
Semicolon |
Semicolon |
Semicolon, optional |
Semicolon |
| Line Comment |
// |
// |
// |
// |
| Block annotations |
/**/ |
/**/ |
/**/ |
/**/ |
| Description Comment |
|
/// |
|
/** Start, * * End |
| Identifier |
Letters, numbers, underscores, must start with a letter or underscore |
Letters, numbers, underscores, must start with a letter or underscore |
Must start with a letter,& and _ can also, but not recommended |
Letters, numbers, underscores, dollar characters, must start with a letter, underscore, or dollar symbol |
| Constant |
#define CONST PI=3.14
Habitually, the constant name is all uppercase. |
Const FLOAT PI=3.14
MSDN recommends using Pascal to name |
No constants |
Final Double pi=3.14
Habitually, the constant name is all uppercase. |
| Data type |
Base type: integer, float, character, enum
Constructed type: array, struct, community
Pointer type
Empty type |
Built-in 15 predefined types
13 Types of values
2 reference types, object,string |
Dynamic types, the same variables can be used for different types.
Number, String, Boolean, Array, object, null,undefined |
Built-in types and reference types.
Available in 8 basic types, 6 numeric types, 1 character types, and 1 Boolean types. |
| String |
String has end tag |
|
can be enclosed in single or double quotation marks.
Quotation marks use: does not match the characters used to include. For example, enclose a single quotation mark, and the interior can contain double quotes. |
|
| Operator |
Comparison operators
==,!=,<,>,<=,>= |
comparison Operators
==,!=,<,>,<=,>= |
comparison Operators
==,!=,<,>,<=,>= |
comparison Operators
==,!=,<,>,<=,>= |
|
logical operators
!,&&,| | |
logical Operators
!,&&,| | |
logical Operators
!,&&,| | |
logical Operators
!,&&,| | |
|
pointer Operators
*,& |
nullable operator
? |
congruent operators, values and types are congruent
=== |
|
|
No string join operator |
String Join operators
+ |
String Join operators
+ |
String Join operators
+ |
| Flow control |
If...else If...else ... |
If...else If...else ... |
If...else If...else ... |
If...else If...else ... |
|
For ... |
For ... |
For ... |
For ... |
|
While ... |
While ... |
While ... |
While ... |
|
|
Foreach... |
for (x in obj) |
for (an int x in array) |
| Array definition |
int a[10]={1,2,3,4,5}; |
Int[] A=new int[10]; |
var a=new Array (10); |
Int[] A=new int[10]; |
|
int a[2][3]={{1,2,3},{4,5,6}} |
int[,] a=new int [2,3]; |
|
Int[][] A=new int[2][3]; |
|
|
|
|
|
|
|
|
|
|