Lesson 3: Object‐Oriented Programming with Java
Yakov Fain · 2015
Java is an object-oriented language, which means that it has constructs to represent objects from the real world. Classes in Java may have methods and fields (also known as attributes). Methods represent actions or functions that a class can perform. The chapter creates and discusses a class named Car. Some values representing an object can change over the program's lifetime (variables) and some remain the same (constants). The chapter sheds more light on the use of both types. There are eight primitive data types in Java. All primitive data types have corresponding wrapper classes that contain useful methods dealing with respective data types. While writing code in Java, one should add comments, which is the text that explains what the program does. The chapter creates and discusses a tax-calculation application in Java. It briefly discusses the concepts of inheritance and method overriding in this example.