Introducing Class, Object and Methods
Class Fundamentals class classname { type instance-variable1; type instance-variable2; // … type instance-variableN; type methodname1(parameter-list) { // body of method } type methodname2(parameter-list) { // body of method } // … type methodnameN(parameter-list) { // body of method } } Here is a class called Box that defines three instance variables: width, height, and depth.…