00:01
Okay, here we have a problem from barron's ap science 7th edition computer science.
00:07
This is a, this book question i think was missing the actual mystery class that it was referencing, not the date class.
00:17
I think the numerate algorithm just messed up the way to pull the actual question.
00:23
So to reference here, this is book question 13 in the book.
00:28
And i just pulled it from the actual book itself.
00:32
So here we have a class mystery and it's got two methods in it.
00:37
One is the strange method, which is going to take two x and two parameters, both integers, one's named x, one's y.
00:44
It's going to take the x parameter and add y to it and reference itself here.
00:50
And y is going to equal y times x.
00:55
And that's after the instance variable x is given a new value up here.
01:00
And then those values are printed out.
01:03
And then next in our, this is our main method.
01:06
This is actually going to instantiate everything and use the strange method here.
01:10
We have two variables declared a and b, six and three.
01:15
And i'm just going to do a manual debug here to kind of demonstrate what happens here.
01:18
So six and three, so a is equal to six at the beginning and b is equal to three, just to clarify.
01:31
And they're going to be passed through the strange method at the beginning, or the second part of the main argument here.
01:39
So we have x is equal to three in this case, and then y is equal to six, because this is also equal to b.
01:54
This is equal to a at this point.
01:57
But just to clarify, x is the instance variable of a.
02:04
A is still holding its own value, same as y.
02:08
Y, or sorry, b is holding its own value and a is holding its own value...