What is a Contract in Solidity?

The contract is similar to classes in java. It is a collection of contract functions and their data(state) that is stored in the ethereum blockchain network.

Syntax of a contract code:

pragma solidity >=0.4.0 <0.6.0;
contract Name{
    //variable declaration

Solidity Compilation Process

                                    --- ABI
Solidity code > Solidity Compiler --|
                                    ---- MachineByte Code -- Ethereum Block chain