• Home
  • Blog
  • CMIT 265 UMUC JAVA OOPS Concept Demonstration with Bank Account Notes

CMIT 265 UMUC JAVA OOPS Concept Demonstration with Bank Account Notes

0 comments

I am working a project that represents Java OOPs concepts. Following is some of the information I need to include.

Create a class called BankAccount below that keeps track of the account holder’s name, the account number, and the balance in the account. Make sure you use the appropriate data types for these.

Write 2 constructors for the class that initialize the instance variables to default values and to given parameters. For the parameters, use the same variable names as your instance variables. Use the this keyword to distinguish between the instance variables and the parameter variables.

Write a withdraw(amount) and deposit(amount) for the class. Withdraw should subtract the amount from the balance as long as there is enough money in the account (the balance is larger than the amount). Deposit should add the amount to the balance. Use the this keyword to refer to the balance. Need to Test your class by creating an object of type BankAccount and calling its deposit and withdraw methods.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}