Yes, contracts have nonces. EIP 161 made the contract nonce start at 1, and before EIP 161 the nonce would start at 0. A nonce of a contract is only incremented when that contract creates another contract (@zanzu's YP reference). When a contract invokes a function on another contract, a so called "internal transaction", the nonce is not incremented.
The nonce can be obtained by using web3.eth.getTransactionCount
. There is no built-in method for a contract to access an account's nonce, including its own. (A contract could use its storage to keep track of its own nonce.)
To make it clear, there are only 2 types of accounts in Ethereum and they all have the same 4 "physical" properties: nonce, balance (in wei), hash of storage trie root, and code. The only "physical" difference is that a contract has non-zero code.
In terms of behavior, there are some more differences between contracts and usual accounts. The incrementing of the nonce is one behavioral difference; another major one is Where is the private key for a contract stored?
To clarify "Usual accounts have a nonce that is increased with every transaction", the nonce of a non-contract account is only incremented when that account originates a transaction (when it's the sender from
account). When an account is the recipient (the to
account), its nonce is not incremented.