Advertisement

Video 8-2 Hey, that's private (part 2)

Video 8-2   Hey, that's private (part 2) In this Java lesson, we review the keywords "private" and "this". We continue talking about "instance fields" which are also called "properties" and "member variables". We will refactor the code to be much better than it was before because before we had a lot of redundant calculations. We did it the awful way to prove a point... that we can (if we wanted to) maintain values in a controlled fashion by using private instance fields with getters & setters. But, now let's do it the right way with Lazy Evaluation.
Mr. Stride at NCHS does a quick demonstration of Lazy Evaluation in the Point class. He will eliminate an instance field for the distance to the origin and shows how calculating it on the fly is much cleaner code. Lazy Evaluation is what you'll want to do when evaluating Cell expressions in TextExcel (when that day comes).

Java,North Creek High School,Mr. Stride,

Post a Comment

0 Comments