ITEC 1620 Lecture 15: 1620_lecture_15_slides

26 views26 pages

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)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents