Constructor Parameters
The next step after creating our first Class is enabling us to send a parameter into the constructor of the class. This way we can automatically send initiation parameters into our new object. Lets see how that can be done.
Video Transcript
00:01All right, so the next step now that we actually created our application what I want to do is I want to give our time
00:07I would basically tell it how long our timer is going to take
00:11Now to do that what I want to do is I just want to send for now
00:14We're just going to send a small number. Let's say we're going to send the value of 10 seconds
00:18I want to create a timeout that will timeout when 10 seconds go by and I'm just going to save them
00:25if I run my application right now, it's going to
00:28Get generate an error because our application constructor is not expecting anything, right?
00:33It's not expecting any parameters. So we're going to have to add those parameters into it
00:38So right now we're sending a first parameter because we decided that we want to have a parameter of 10 seconds
00:43So to do that, I'm just going to add a new variable. I'm going to call it
00:46It's going to be a type of integer not only that I'm going to set it to be 0 by default
00:52By setting it to 0 by default I could or send something or not
00:55So if I send something my application will run and if I don't send anything my application will run anyways
01:02Okay, so this is a great way to
01:04Give both options
