In this lesson, students learn about the overarching idea of “using a class as a client”. In Java, everything is represented as a class. Classes are a nice way of bundling up functionality. There are classes written for a lot of common needs (such as the String
class and the Character
class), and we can use these classes in our programs.
When someone else creates a class, and you use the functionality of that class, that is called being a client of the class. Users don’t need to know exactly how everything works inside the class, they can just use all the functionality of that class without worrying about the inner workings. For example, you can use the String class to create String objects, and call methods on the objects to get information like the length and the characters at certain indices, without ever looking at the source code for the String class.
Students will be able to:
These are all the activities included in the lesson