Conditional Expressions and Statements : 01/20/2023
Operations on Variables : 01/19/2023
Variables and Types : 01/18/2023
Welcome to CS 124 : 01/17/2023
Next we continue our exploration of Java objects.
Objects combine state and behavior.
Yesterday we showed how they can store data like variables.
Now we’ll show how they can run algorithms like methods.
What we’ve created above is called an instance method.
In some ways it’s just like the other methods that we’ve written.
But, because it is part of a class definition, it is also different.
Specifically, instance methods have access to the values of instance variables or properties.
We saw that in the walkthrough above, since our print function could access that room’s width, height, and name.
Let’s continue exploring this together, and look at how instance methods can both access instance variables and accept parameters.
If you’ve ever found yourself searching for technology product reviews on YouTube, you may have already run across the work of Marques Brownlee.
A YouTube technology reviewer with 16 million subscribers, Marques is also a high-level professional Ultimate frisbee player.
In the video below he discusses some of the challenges with being a diverse individual in technology with another fairly well-known Black man, Barack Obama: