ITEC 1620 Lecture 15: 1620_lecture_15_slides
Document Summary
Object-based programming is structured programming using objects. All object information is in the api g. Methods that interact with instance data must be instance methods. Methods that do not interact with instance data can be class methods. Class data and methods are identified as static . Static fields and methods can be f accessed by the class name or by an instance variable/identifier instance variable/identifier. Sets interest rate for myaccount and y youraccount myaccount setrate(2 75); myaccount. setrate(2. 75); Sets interest rate for myaccount and youraccount youraccount. Non-static methods have access to both static and non-static fields and methods. Money is an integer number of dollars and an integer number of cents (from 0 and an integer number of cents (from 0 to 99) Int dollars and int cents int dollars and int cents. Java supplies these for java"s f (primitive) datatypes. You have to provide them for your f datatypes. Understanding objects iv static money add(money first, money second)