The naming convention is the same as java.
We have few extra datatypes like
🔲 uint (Unsigned integer)
🔲 struct (Similar to a class in java) - Doesn't have a constructor
uint - Unsigned Integer - int data type that only stores non-negative integers i.e 0 and positive integers.
For e.g, if an int can store 256 numbers, the range of int will be from -128 to 127. But the range of uint will be 0 to 255.
For calculating an exponential, there is an extra operator **
uint x = 5 ** 3;
The value of x will be 125.
In java, let us assume we have a person class and for storing the address we use a separate class that has houseNumber and streetName. We can use struct here
There is no new keyword in solidity. If we want to create a new address, the syntax is
Address myAddress = Address(1,"Baker street");
We can push this into an array (similar to javascript)
Address[] addresses;
addresses.push(myAddress);
Functions - all functions are by default public in solidity - Which means anyone (or any other contract) can call your contract's function and execute its code.
The function declaration is slightly different - In my opinion, it is a combination of java and javascript styles
Example:
We need to use the 'function' keyword at start followed by name of function.
The main difference is we shift the public/private keyword & return type to the end of the declaration