What do you understand by instantiating an object, JAVA Programming

Assignment Help:

Question:

(a) To be considered object-oriented(OO), a language should support abstraction, encapsulation, inheritance and polymorphism.

Explain briefly each of the terms in bold font.

(b) What do you understand by "instantiating an object"?

(c) A bank account has two pieces of data - a password and a balance, and as actions to act on that data, it allows a user to create account, make deposits, make withdrawals, and to check the balance.

Deposit is used to add cash to the account. It simply increments Balance by the amount of the deposit. Withdraw is used to remove cash from the account. However, it needs to be a bit selective. First it checks to see if the password passed in matches the initial password. It also checks to ensure that the amount requested to be withdrawn is available in the account. If it passes these two conditions, then Balance is decremented by the amount of the withdrawal. GetBalance checks the password and then returns balance.

Write a script which has four methods to act on the bank data: new, mDeposit, mWithdraw, and mGetBalance.

(d) (i) Give three advantages of using Parent scripts in place of globals.

(ii) Give three disadvantages of using Parent scripts in place of globals.


Related Discussions:- What do you understand by instantiating an object

How to convert string value to number in java, How to convert string value ...

How to convert string value to number in java? While processing user input it is frequent essential to convert a String in which the user enters into an int . The syntax is

Publish subscribe model and p2p model, What is the basic difference among P...

What is the basic difference among Publish Subscribe model and P2P model? Ans) Publish Subscribe model is typically used in one-to-many situation. It is unreliable but very quic

What is final class, What is final class? A final class can't be extend...

What is final class? A final class can't be extended ie., final class might not be subclassed. A final method can't be overridden when its class is inherited. You can't alter v

Java assignment, Java Project Introduction: In this project, you will ex...

Java Project Introduction: In this project, you will explore a few sorting algorithms. You will also test their efficiency by both timing how long a given sorting operation take

Describe what is bytecode, Describe what is bytecode? It is an inst...

Describe what is bytecode? It is an instruction set. It extends with class. 'javac' compiler translates the .java file into .class. JVM interprets bytecode.

Write program to passing arguments to methods, Write program to Passing Arg...

Write program to Passing Arguments to Methods ? It's generally considered bad form to access fields directly. Instead it is considered outstanding object oriented practice to

AdressBook, Write a program that uses one of the Map classes to implement a...

Write a program that uses one of the Map classes to implement a contact list. Contact information should include first name, last name, a phone number and an email address. The lis

Cross platform stock market game, Cross platform stock market game Proje...

Cross platform stock market game Project Description: I want someone to develop a simple stock market game. This will mainly be a facebook and android app, face book being mo

Convert US Dollars to Canadian Dollars, How to write a program that convert...

How to write a program that converts US dollars into Canadian dollars.The program let the user enter an amount in US dollars and display it equivalent value in Canadian dollars whe

K-means clustering, i) Set the number of data points to 20 and the number o...

i) Set the number of data points to 20 and the number of clusters to 2. Check box Show History. Click on Initialize. Click on Start. Click on Step . Observe which points ch

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd