8
Classes, Objects, and Enums
In Chapter 7, we learned about methods in Java. After understanding why methods are useful, we learned that there are two parts to methods – the method definition and the method call. We saw that the method definition is the code that’s executed when the method is invoked via the method call. We discussed how method signatures enable method overloading. We also learned how varargs helps us call a method with zero or more arguments. Finally, we discussed Java’s call by value mechanism, where arguments that are passed to a method are copied in memory. Depending on the type of argument passed, primitive or reference, will have implications as to the effect of the changes made in the called method to those arguments ...
Get Learn Java with Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.