3 Introduction to Classes, Objects, Methods and Strings
Objectives
In this chapter you’ll:
-
Declare a class and use it to create an object.
-
Implement a class’s behaviors as methods.
-
Implement a class’s attributes as instance variables.
-
Call an object’s methods to make them perform their tasks.
-
Learn what local variables of a method are and how they differ from instance variables.
-
Learn what primitive types and reference types are.
-
Use a constructor to initialize an object’s data.
-
Represent and use numbers containing decimal points.
-
Learn why classes are a natural way to model real-world things and abstract entities.
Get Java How to Program, Early Objects, 11th Edition 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.