正在加载图片...
Objects(extension of variables) a class template Data Fields radius is Methods getAe Circle Object I Circle Object 2 I Circle Object 3 ← Three objects of the circle Data fields Data fields Data fields radius is 10 radius is radIus Is An object has both a state and behavior State defines the object Behavior defines what the object does What is the size of an object in the memory11 Objects (extension of variables) • An object has both a state and behavior. • State defines the object, • Behavior defines what the object does. • What is the size of an object in the memory? Class Name: Circle Data Fields: radius is _______ Methods: getArea Circle Object 1 Data Fields: radius is 10 Circle Object 2 Data Fields: radius is 25 Circle Object 3 Data Fields: radius is 125 A class template Three objects of the Circle class
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有