methods for accessing and modifying this data every object is an instance of classwhich defines the type of the objectas well as the kinds of operations that it performs the critical members of class in java are the following (classes can also contain inner class definitionsbut let us defer discussing this concept for now)data of java objects are stored in instance variables (also called fieldsthereforeif an object from some class is to store dataits class must specify the instance variables for such objects instance variables can either come from base types (such as integersfloating-point numbersor booleansor they can refer to objects of other classes the operations that can act on dataexpressing the "messagesobjects respond toare called methodsand these consist of constructorsproceduresand functions they define the behavior of objects from that class how classes are declared in shortan object is specific combination of data and the methods that can process and communicate that data classes define the types for objectshenceobjects are sometimes referred to as instances of their defining classbecause they take on the name of that class as their type an example definition of java class is shown in code fragment code fragment counter class for simple counterwhich can be accessedincrementedand decremented