I learned that solidity contracts and OOP (object-oriented programming) classes, such as those in Java, are similar in many aspects. They can have constructors, class methods with public/private usage, and variable declaration/initialization. Also, they can be instantiated.

Those are some similarities and maybe I got something wrong, but I am very eager to know the differences between Solidity contracts and classes in OOP.

1 Answer 1


They are really similar, but not quite the same. The language is the same in many cases, and i think they were going for that, but there are even more fundamental differences that the fact that solidity contracts can store and send value and have a public address once deployed.

This question was asked before too, and there were some good answers. Is a smart contract analogous to an OOP class?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.