FUNDAMENTALS
Object-oriented programming’s roots date back several decades to languages such as Simula and Smalltalk. OOP has been the subject of much academic research and debate, especially since the widespread adoption of OOP languages by practicing developers.
Classes and Objects
No clear consensus exists on the many different ways to describe and define object orientation as a programming technique, but all of them revolve around the notions of classes and objects. A class is an abstract definition of something that has attributes (sometimes called properties or states) and actions (capabilities or methods). An object is a specific instance of a class that has its own state separate from any other object instance. Here’s a class definition for Point
, which is a pair of integers that represents the x and y values of a point in a Cartesian coordinate plane:
public class Point {
private int x;
private int y;
public Point( int x, int y ){
this.x = x...