Day 5. Creating Classes and Methods
If you’re coming to Java from another programming language, you might be struggling with the meaning of the term class. It seems synonymous with the term program, but you might be uncertain of the relationship between the two.
In Java, a program is made up of a main class and any other classes needed to support the main class. These support classes include any you might need in the Java Class Library, such as String
, Math
, and the like.
Today, the meaning of class is clarified as you create classes and methods, which define the behavior of an object or class. You learn about each of the following:
The parts ...
Get Sams Teach Yourself Java™ in 21 Days (Covering Java 8), Seventh 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.