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

Garbage collection model, This assignment is about experimenting with the J...

This assignment is about experimenting with the Java runtime system's garbage collection model, and comparing it with the C++ manual memory allocation model. Below is the Garbage J

Explain what is local variable, Explain what is Local Variable ? Declar...

Explain what is Local Variable ? Declaring variables (using the var keyword) inside a function forms them local. They are available only inside the function and hold no meaning

String, solve the string public int expression("10+20+30")

solve the string public int expression("10+20+30")

What is javaserver faces conversion model, A mechanism for converting among...

A mechanism for converting among string-based markup generated by JavaServer Faces UI components and server-side Java objects.

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

XML File Homework, I need help on java homework. Is it possible to know the...

I need help on java homework. Is it possible to know the shortest possible time to get the solution before giving my commitment

Methods, I need the five methods public class Ex1Program { public void...

I need the five methods public class Ex1Program { public void start() { // Step 1. Declare and construct an array of 19 Movie objects (call the array films)

Session scope and Request scope, What is the difference among session scope...

What is the difference among session scope and request scope when saving formbean? Ans) When the scope is request, the values of formbean would be there for the current request.

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