Skip to content

A Small Doubt from chapter 3 of the tutorial #871

Answered by krakxn
ArkX69 asked this question in Q&A
Discussion options

You must be logged in to vote

Explanation:

First we initialize simpleStorage, a variable (of type SimpleStorage)
then, in our declaration, we instantiate it as a SimpleStorage object with the help of the new keyword
and the brackets are necessary because whenever we instantiate an object, it first calls the constructor of that object
so, empty parameters here means that we are calling the default constructor of SimpleStorage, as our object is of that type
and in the future, you will also see parameterized constructors which are essentially the same but with arguments - and then, in that case, you will see parameters being implemented in the declaration

Hope this helped! Good luck with the course

EDIT: BTW, I would r…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@shoaibshebi
Comment options

@ArkX69
Comment options

@krakxn
Comment options

@ArkX69
Comment options

@krakxn
Comment options

Answer selected by ArkX69
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants