Vous êtes sur la page 1sur 40

Object Oriented Concepts Using Java > Post Test

1. What is the output of following code snippet


interface !nterOne"
int varOne#1$$$%
int varTwo#&$$$%
void displa'()%
*
abstract class +bstractOne"
int varThree%
abstract void disp()%
*
class ,-a.ple e-tends +bstractOne i.ple.ents !nterOne"
int varThree%
,-a.ple()"
varThree#1$%
*
*
public void displa'()"
/'ste..out.println(0varOne value102varOne)%
*
public void disp()"
int varThree#1$$%
/'ste..out.println(0varTwo value 102varTwo)%
/'ste..out.println(0varThree value102varThree)%
/'ste..out.println(0varThree value102super.varThree)%
*
*
class 3e.o"
public static void .ain(/tring args45)"
,-a.ple obj#new ,-a.ple()%
obj.displa'()%
obj.disp()%
*
*
Options
a)varOne value11$$$
varTwo value1&$$$
varThree value11$$
varThree value1$
b)varOne value11$$$
varTwo value1&$$$
varThree value11$
varThree value1$
c) varOne value11$$$
varTwo value1&$$$
varThree value11$$
varThree value11$
d) varOne value11$$$
varTwo value1&$$$
varThree value1$
varThree value11$$ +nswer1a
& Consider the following1
There is a class called /hape in a pac6age called draw.
Choose the option which represents the CO77,CT state.ent which will i.port the
/hape class fro. the draw pac6age into another pac6age
Options
a)i.pot draw8% b)i.port draw.8%
c)i.port /hape.draw.8% d)i.port java.draw.8% answer1b
9 What is the output of following code snippet
abstract class ,-a.pleOne"
int dataOne#1$$$%
abstract void displa'()%
*
class ,-a.pleTwo e-tends ,-a.pleOne"
int dataTwo%
,-a.pleTwo(int varOne)"
dataTwo#varOne%
*
public void disp()"
/'ste..out.println(0!nfos's :angalore0)%
*
public void displa'()"
/'ste..out.println(dataOne)%
*
*
class ,-a.ple"
public static void .ain(/tring args45)"
,-a.pleOne obj#new ,-a.pleTwo(&$)%
obj.disp()%
obj.displa'()%
*
*
Options
a)Co.pilation error 1cannot find s'.bol disp()
b)!nfos's :angalore
$
c)!nfos's :angalore
d) !nfos's :angalore
1$$$ answer1 a
; Which of the following state.ent is T7U, related to !nterfaces
Options answer1 c
a)+n object of an interface can be instantiated
b)+ll the .ethods in an interface are final b' default
c)+ll the .ethods in an interface are abstract b' default
d)!nterfaces contain onl' .ethods and cannot contain variables
< Consider that a .ain .ethod is declared as public static void .ain(/tring 45args).
Choose the option that represents the e-pression to find the nu.ber of co..and
line argu.ents passed to the .ain .ethod.
Options
a) args.length = 1 b) args.length
c) args.length () = 1 d) args.length () answer1 b
> What is the output of following code snippet
class 3e.o"
public static void .ain(/tring args45)"
/tring string1 # new /tring(0+:C0)%
/tring string&# new /tring(0+:C0)%
/'ste..out.println(string1##string&)%
/'ste..out.println(string1.e?uals(string&))%
*
*
Options
a) true
true
b) true
false
c) false
false
d) false
true answer1 d
@ What is the output of following code snippet
public class Aain3e.o"
public static void .ain(/tring args45)"
float arra'One45 # "1B &B 9B ;B<*%
for(int i!nde-#$% i!nde-Carra'One.length% i!nde-22)
"
arra'One4i!nde-5 # i!nde-%
i!nde-#i!nde-21%
*
for(int i!nde-#$% i!nde-Carra'One.length% i!nde-22)
"
/'ste..out.println(arra'One4i!nde-5)%
*
*
*
Options
a) 1.$
&.$
9.$
;.$
<.$
b) $.$
1.$
&.$
9.$
;.$
c) $.$
&.$
&.$
;.$
;.$
d) 1.$
1.$
9.$
9.$
<.$ answer1c
D Case /tud'
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Flobal Corp :an6 is a global ban6ing organiGation that provides standard ban6ing
services to its custo.ers spread across the globe. The vision of the ban6 is H:an6ing
/i.plifiedH. The head office is located in Chicago and the ban6 has presence in .ore
than 9$ countries with client base of nearl' >$$B$$$. The ban6 has several branches
in different cities% each branch is identified b' a ; digit code.
Flobal Corp :an6 is well 6nown a.ong its clients for worldEclass processesB speed of
e-ecution and financial acu.en. The ban6 has .ade a proposal for investing around
I&$$ .illion in settingEup &;-@ ban6ing support facilities for the custo.ers. The ai.
of the proposed ban6ing s'ste. is to create a paperless ban6. The ban6 leverages !T
for auto.ating several of its business processes which includes1
Aanaging Custo.er +ccounts
Transaction Aanage.ent
The account holders are provided with a webEbased interface for the following basic
services1
Chec6ing +ccount :alance
Jund transfer
Changing the account password
7e?uest for de.and draft andKor Che?ue :oo6s
Proble. /tate.ent1
Over the last couple of 'ears the reach of Flobal Corp has grown significantl'. !t has
seen a radical rise in the nu.ber of clients and transactions. 7ecentl' the ban6 has
also witnessed a dra.atic increase in co.petition fro. other financial institutions.
This .ar6et situation has pro.pted Flobal Corp to introduce new efficientB reliable
and scalable operational .ethodologies.
Junctional /pecifications1
Flobal Corp ban6 provides following account services1
1. 3epositor' +ccounts
a. Current account
b. Ji-ed deposit account
c. /avings ban6 account
&. Loan +ccounts
a. ,ducation Loan
b. Mehicle Loan
c. Nouse :uilding Loan
d. :usiness Loan
e. +griculture Loan
f. Consu.er ,lectronics Loan
7elated functionalities for the account services1
1. Opening an account
&. Operating on depositor' account
a. 3eposit cash
b. Withdraw cash
c. Jund Transfer
d. 7elated /ervices
9. Operating on loans account
;. Closing an account
1. OP,O!OF +O +CCOUOT
,ach new opened account should have a 19 character uni?ue account nu.ber.
The account nu.ber should be in the following for.at1
CCPPPQQQQRRRR
NereB
CC denotes the account t'pe. Jor e-a.ple1
3C 1 3epositor' Current +ccount
LN 1 Loan +ccount for No.e
PPP denotes ban6 code which is @1@ for the Flobal Corp ban6
QQQQ denotes branch code which varies fro. branch to branch
RRRR denotes the custo.er nu.ber which starts fro. $$$1 for a account t'pe in
a branch and incre.ents se?uentiall' b' 1

E>!t should not be possible to .odif' the account nu.ber at an' stage
E>+ccount nu.ber should be generated b' s'ste. in the ascending order
E>The s'ste. should record the na.e and address of the account holder as
these are .andator'
E>The .ini.u. a.ount to open an account is I1$$
E>,ach account holder gets a user na.e and password that he can use to login
on web interface for basic services
&. OP,7+T!OF OO 3,PO/!TO7Q +CCOUOT
a. 3eposit Cash
E>+ deposit should be for a .ini.u. a.ount of I1$
E>3eposit should be a .ultiple of I1$
E>Whenever a deposit is .adeB the updated balance should be .ade 6nown to
the account holder
E>There is no upper li.it for account balance in case of current and fi-ed deposit
account t'pes
E>/avings ban6 account have an upper li.it of I<$$B$$$ as account balance
E>Jor fi-ed depositor' accountB onl' one ti.e deposit is allowed
b. Withdraw Cash

Jor Current and /aving account t'pe
E>Cash can be withdrawn b' Che?ues and 3ebit Cards
E>Aini.u. a.ount of withdrawal is I1$
E>+ccount balance should never be less than I1$$ for saving account and I$ for
current account(Oo overdraft facilit' is available)
E>Whenever a withdrawal is .adeB the updated balance should be .ade 6nown
to the account holder
E>Withdrawals .a' be .ade fro. an' of the branches or through +TA outlets as
designated b' the ban6
E>With the ban6Hs debit cardB one can shop using onEline debit .odule and
charge to the account directl'
Jor Ji-ed deposit account t'pe
E>Withdrawal fro. an account will result in the closing of the account
E>On closing of fi-ed deposit account t'pe principle a.ount along with applicable
interest should be .ade available to the custo.er

c. Jund Transfer
E>Onl' intra ban6 fund transfer is allowed
E>,ach user has a .a-i.u. fund transfer li.it of I1$$$ per da'
E>Jund transfer will adhere to standard deposit and withdrawal rules
d. 7elated /ervices
E>3e.and draft re?uest
E>Password change re?uest
E>+ccount state.ent re?uest
E>7e?uest for che?ue boo6s
9. OP,7+T!OF OO LO+O +CCOUOT
3ifferent loan sche.es provided b' Flobal Corp ban6 are listed as follows1
i. ,ducation Loan
ii. Mehicle Loan
iii. Nouse :uilding Loan
iv. :usiness Loan
v. +griculture Loan
vi. Consu.er ,lectronics Loan
E>Aini.u. a.ountB .a-i.u. a.ountB ter. of loanB rate of interest and
re?uire.ent of .ortgage depends upon the repa'.ent capabilit' of the applicant
E>:an6 will provide loans to its account holders charging a higher rate of interest
than that given b' the ban6 to saving and current account custo.ers
;. CLO/!OF +O +CCOUOT
E>:efore closing an accountB the account balance should be Gero
E>The status of the account will be set to 0closed0
E>+ll accounts that have not been operated for 1$ 'ears will be considered as
dor.ant account
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Suestion1
The criteria to be .et for closing an account b' a custo.er is that the account
balance should be Gero. Jor using this functionalit' B the user has to choose an
option ; fro. a .enu.When the account is closedB the status of the +ccount is set to
HClosedH for the custo.er. Which of these options de.onstrate this functionalit'
+ssu.ptions1
UserChoice is a variable that contains the choice entered b' the user to e-ecute
functionalit'. The option nu.ber ; is used to close an account
User+ccount:al1 The variable which contains the balance in the account of the
current user account
set/tatus() .ethod is used to set the status of the account i.e. HOpenH or HClosedH.
(i) !f(UserChoice##;)"
!f (User+ccount:al##$)"
account.set/tatus(0Closed0)%
*
*
(ii) !f(UserChoice##; TT User+ccount:al##$)"
account.set/tatus(0Closed0)%
*
Options
a)Onl' (i) b) Onl' (ii)
c) Oeither (i) nor (ii) d)both (i) U (ii) answer1a
V Case /tud'
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

Flobal Corp :an6 is a global ban6ing organiGation that provides standard ban6ing
services to its custo.ers spread across the globe. The vision of the ban6 is H:an6ing
/i.plifiedH. The head office is located in Chicago and the ban6 has presence in .ore
than 9$ countries with client base of nearl' >$$B$$$. The ban6 has several branches
in different cities% each branch is identified b' a ; digit code.
Flobal Corp :an6 is well 6nown a.ong its clients for worldEclass processesB speed of
e-ecution and financial acu.en. The ban6 has .ade a proposal for investing around
I&$$ .illion in settingEup &;-@ ban6ing support facilities for the custo.ers. The ai.
of the proposed ban6ing s'ste. is to create a paperless ban6. The ban6 leverages !T
for auto.ating several of its business processes which includes1
Aanaging Custo.er +ccounts
Transaction Aanage.ent
The account holders are provided with a webEbased interface for the following basic
services1
Chec6ing +ccount :alance
Jund transfer
Changing the account password
7e?uest for de.and draft andKor Che?ue :oo6s
Proble. /tate.ent1
Over the last couple of 'ears the reach of Flobal Corp has grown significantl'. !t has
seen a radical rise in the nu.ber of clients and transactions. 7ecentl' the ban6 has
also witnessed a dra.atic increase in co.petition fro. other financial institutions.
This .ar6et situation has pro.pted Flobal Corp to introduce new efficientB reliable
and scalable operational .ethodologies.
Junctional /pecifications1
Flobal Corp ban6 provides following account services1
Options
1. 3epositor' +ccounts
a. Current account
b. Ji-ed deposit account
c. /avings ban6 account
&. Loan +ccounts
a. ,ducation Loan
b. Mehicle Loan
c. Nouse :uilding Loan
d. :usiness Loan
e. +griculture Loan
f. Consu.er ,lectronics Loan
7elated functionalities for the account services1
1. Opening an account
&. Operating on depositor' account
a. 3eposit cash
b. Withdraw cash
c. Jund Transfer
d. 7elated /ervices
9. Operating on loans account
;. Closing an account
1. OP,O!OF +O +CCOUOT
,ach new opened account should have a 19 character uni?ue account nu.ber.
The account nu.ber should be in the following for.at1
CCPPPQQQQRRRR
NereB
CC denotes the account t'pe. Jor e-a.ple1
3C 1 3epositor' Current +ccount
LN 1 Loan +ccount for No.e
PPP denotes ban6 code which is @1@ for the Flobal Corp ban6
QQQQ denotes branch code which varies fro. branch to branch
RRRR denotes the custo.er nu.ber which starts fro. $$$1 for a account t'pe in
a branch and incre.ents se?uentiall' b' 1

E>!t should not be possible to .odif' the account nu.ber at an' stage
>+ccount nu.ber should be generated b' s'ste. in the ascending order
E>The s'ste. should record the na.e and address of the account holder as
these are .andator'
E>The .ini.u. a.ount to open an account is I1$$
E>,ach account holder gets a user na.e and password that he can use to login
on web interface for basic services
he can use to login on web interface for basic services
&. OP,7+T!OF OO 3,PO/!TO7Q +CCOUOT
a. 3eposit Cash
E>+ deposit should be for a .ini.u. a.ount of I1$
E>3eposit should be a .ultiple of I1$
E>Whenever a deposit is .adeB the updated balance should be .ade 6nown to
the account holder
E>There is no upper li.it for account balance in case of current and fi-ed deposit
account t'pes
E>/avings ban6 account have an upper li.it of I<$$B$$$ as account balance
E>Jor fi-ed depositor' accountB onl' one ti.e deposit is allowed
b. Withdraw Cash

Jor Current and /aving account t'pe
E>Cash can be withdrawn b' Che?ues and 3ebit Cards
E>Aini.u. a.ount of withdrawal is I1$
E>+ccount balance should never be less than I1$$ for saving account and I$ for
current account(Oo overdraft facilit' is available)
E>Whenever a withdrawal is .adeB the updated balance should be .ade 6nown
to the account holder
E>Withdrawals .a' be .ade fro. an' of the branches or through +TA outlets as
designated b' the ban6
E>With the ban6Hs debit cardB one can shop using onEline debit .odule and
charge to the account directl'
Jor Ji-ed deposit account t'pe
E>Withdrawal fro. an account will result in the closing of the account
E>On closing of fi-ed deposit account t'pe principle a.ount along with applicable
interest should be .ade available to the custo.er
c. Jund Transfer
E>Onl' intra ban6 fund transfer is allowed
E>,ach user has a .a-i.u. fund transfer li.it of I1$$$ per da'
E>Jund transfer will adhere to standard deposit and withdrawal rules
d. 7elated /ervices
E>3e.and draft re?uest
E>Password change re?uest
E>+ccount state.ent re?uest
E>7e?uest for che?ue boo6s
9. OP,7+T!OF OO LO+O +CCOUOT
3ifferent loan sche.es provided b' Flobal Corp ban6 are listed as follows1
i. ,ducation Loan
ii. Mehicle Loan
iii. Nouse :uilding Loan
iv. :usiness Loan
v. +griculture Loan
vi. Consu.er ,lectronics Loan
E>Aini.u. a.ountB .a-i.u. a.ountB ter. of loanB rate of interest and
re?uire.ent of .ortgage depends upon the repa'.ent capabilit' of the applicant
E>:an6 will provide loans to its account holders charging a higher rate of interest
than that given b' the ban6 to saving and current account custo.ers
;. CLO/!OF +O +CCOUOT
E>:efore closing an accountB the account balance should be Gero
E>The status of the account will be set to 0closed0
E>+ll accounts that have not been operated for 1$ 'ears will be considered as
dor.ant account
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
The account nu.ber of an +ccount is auto generated ever' ti.e a new account is
created.This holds whole nu.bers. The accountOu.ber variable contains the uni?ue
account nu.ber for ever' +ccount. What should be the datat'pe of the +ccount
nu.ber variable
a) char b) int
c) static int d) static char answer1 b
1$ Case /tud'
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Flobal Corp :an6 is a global ban6ing organiGation that provides standard ban6ing
services to its custo.ers spread across the globe. The vision of the ban6 is H:an6ing
/i.plifiedH. The head office is located in Chicago and the ban6 has presence in .ore
than 9$ countries with client base of nearl' >$$B$$$. The ban6 has several branches
in different cities% each branch is identified b' a ; digit code.
Flobal Corp :an6 is well 6nown a.ong its clients for worldEclass processesB speed of
e-ecution and financial acu.en. The ban6 has .ade a proposal for investing around
I&$$ .illion in settingEup &;-@ ban6ing support facilities for the custo.ers. The ai.
of the proposed ban6ing s'ste. is to create a paperless ban6. The ban6 leverages !T
for auto.ating several of its business processes which includes1
Aanaging Custo.er +ccounts
Transaction Aanage.ent
The account holders are provided with a webEbased interface for the following basic
services1
Chec6ing +ccount :alance
Jund transfer
Changing the account password
7e?uest for de.and draft andKor Che?ue :oo6s
Proble. /tate.ent1
Over the last couple of 'ears the reach of Flobal Corp has grown significantl'. !t has
seen a radical rise in the nu.ber of clients and transactions. 7ecentl' the ban6 has
also witnessed a dra.atic increase in co.petition fro. other financial institutions.
This .ar6et situation has pro.pted Flobal Corp to introduce new efficientB reliable
and scalable operational .ethodologies.
Junctional /pecifications1
Flobal Corp ban6 provides following account services1
1. 3epositor' +ccounts
a. Current account
b. Ji-ed deposit account
c. /avings ban6 account
&. Loan +ccounts
a. ,ducation Loan
b. Mehicle Loan
c. Nouse :uilding Loan
d. :usiness Loan
e. +griculture Loan
f. Consu.er ,lectronics Loan
7elated functionalities for the account services1
1. Opening an account
&. Operating on depositor' account
a. 3eposit cash
b. Withdraw cash
c. Jund Transfer
d. 7elated /ervices
9. Operating on loans account
;. Closing an account
1. OP,O!OF +O +CCOUOT
,ach new opened account should have a 19 character uni?ue account nu.ber.
The account nu.ber should be in the following for.at1
CCPPPQQQQRRRR
NereB
CC denotes the account t'pe. Jor e-a.ple1
3C 1 3epositor' Current +ccount
LN 1 Loan +ccount for No.e
PPP denotes ban6 code which is @1@ for the Flobal Corp ban6
QQQQ denotes branch code which varies fro. branch to branch
RRRR denotes the custo.er nu.ber which starts fro. $$$1 for a account t'pe in
a branch and incre.ents se?uentiall' b' 1

E>!t should not be possible to .odif' the account nu.ber at an' stage
E>+ccount nu.ber should be generated b' s'ste. in the ascending order
E>The s'ste. should record the na.e and address of the account holder as
these are .andator'
E>The .ini.u. a.ount to open an account is I1$$
E>,ach account holder gets a user na.e and password that he can use to login
on web interface for basic services
&. OP,7+T!OF OO 3,PO/!TO7Q +CCOUOT
a. 3eposit Cash
E>+ deposit should be for a .ini.u. a.ount of I1$
E>3eposit should be a .ultiple of I1$
E>Whenever a deposit is .adeB the updated balance should be .ade 6nown to
the account holder
E>There is no upper li.it for account balance in case of current and fi-ed deposit
account t'pes
E>/avings ban6 account have an upper li.it of I<$$B$$$ as account balance
E>Jor fi-ed depositor' accountB onl' one ti.e deposit is allowed
b. Withdraw Cash

Jor Current and /aving account t'pe
E>Cash can be withdrawn b' Che?ues and 3ebit Cards
E>Aini.u. a.ount of withdrawal is I1$
E>+ccount balance should never be less than I1$$ for saving account and I$ for
current account(Oo overdraft facilit' is available)
E>Whenever a withdrawal is .adeB the updated balance should be .ade 6nown
to the account holder
E>Withdrawals .a' be .ade fro. an' of the branches or through +TA outlets as
designated b' the ban6
E>With the ban6Hs debit cardB one can shop using onEline debit .odule and
charge to the account directl'
Jor Ji-ed deposit account t'pe
E>Withdrawal fro. an account will result in the closing of the account
E>On closing of fi-ed deposit account t'pe principle a.ount along with applicable
interest should be .ade available to the custo.er

c. Jund Transfer
E>Onl' intra ban6 fund transfer is allowed
E>,ach user has a .a-i.u. fund transfer li.it of I1$$$ per da'
E>Jund transfer will adhere to standard deposit and withdrawal rules
d. 7elated /ervices
E>3e.and draft re?uest
E>Password change re?uest
E>+ccount state.ent re?uest
E>7e?uest for che?ue boo6s
9. OP,7+T!OF OO LO+O +CCOUOT
3ifferent loan sche.es provided b' Flobal Corp ban6 are listed as follows1
i. ,ducation Loan
ii. Mehicle Loan
iii. Nouse :uilding Loan
iv. :usiness Loan
v. +griculture Loan
vi. Consu.er ,lectronics Loan
E>Aini.u. a.ountB .a-i.u. a.ountB ter. of loanB rate of interest and
re?uire.ent of .ortgage depends upon the repa'.ent capabilit' of the applicant
E>:an6 will provide loans to its account holders charging a higher rate of interest
than that given b' the ban6 to saving and current account custo.ers
;. CLO/!OF +O +CCOUOT
E>:efore closing an accountB the account balance should be Gero
E>The status of the account will be set to 0closed0
E>+ll accounts that have not been operated for 1$ 'ears will be considered as
dor.ant account
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+ developer is wor6ing on the .enu navigation of the application. The .enu re?uires
ta6ing user input through co..and line argu.ents. The choices available to user in
the .enu are nu.eric in nature. :utB when the nu.ber value (e.g. ;) is passed
through co..and line argu.ents and used in the progra. Bthere is an error
.essage1
T'pe .is.atch1 cannot convert fro. /tring to int
What could be the possible solution to this issue
Options
a) +ccept the argu.ent in a string for.at
b) Convert the argu.ent into an integer t'pe using !nteger.decode().ethod
c) Convert the argu.ent into an integer t'pe using !nteger.parselnt() .ethod
d) Convert the argu.ent into an integer t'pe using !nteger.to/tring().etod
answer1c
11 Case /tud'
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Flobal Corp :an6 is a global ban6ing organiGation that provides standard ban6ing
services to its custo.ers spread across the globe. The vision of the ban6 is H:an6ing
/i.plifiedH. The head office is located in Chicago and the ban6 has presence in .ore
than 9$ countries with client base of nearl' >$$B$$$. The ban6 has several branches
in different cities% each branch is identified b' a ; digit code.
Flobal Corp :an6 is well 6nown a.ong its clients for worldEclass processesB speed of
e-ecution and financial acu.en. The ban6 has .ade a proposal for investing around
I&$$ .illion in settingEup &;-@ ban6ing support facilities for the custo.ers. The ai.
of the proposed ban6ing s'ste. is to create a paperless ban6. The ban6 leverages !T
for auto.ating several of its business processes which includes1
Aanaging Custo.er +ccounts
Transaction Aanage.ent
The account holders are provided with a webEbased interface for the following basic
services1
Chec6ing +ccount :alance
Jund transfer
Changing the account password
7e?uest for de.and draft andKor Che?ue :oo6s
Proble. /tate.ent1
Over the last couple of 'ears the reach of Flobal Corp has grown significantl'. !t has
seen a radical rise in the nu.ber of clients and transactions. 7ecentl' the ban6 has
also witnessed a dra.atic increase in co.petition fro. other financial institutions.
This .ar6et situation has pro.pted Flobal Corp to introduce new efficientB reliable
and scalable operational .ethodologies.
Junctional /pecifications1
Flobal Corp ban6 provides following account services1
1. 3epositor' +ccounts
a. Current account
b. Ji-ed deposit account
c. /avings ban6 account
&. Loan +ccounts
a. ,ducation Loan
b. Mehicle Loan
c. Nouse :uilding Loan
d. :usiness Loan
e. +griculture Loan
f. Consu.er ,lectronics Loan
7elated functionalities for the account services1
1. Opening an account
&. Operating on depositor' account
a. 3eposit cash
b. Withdraw cash
c. Jund Transfer
d. 7elated /ervices
9. Operating on loans account
;. Closing an account
1. OP,O!OF +O +CCOUOT
,ach new opened account should have a 19 character uni?ue account nu.ber.
The account nu.ber should be in the following for.at1
CCPPPQQQQRRRR
NereB
CC denotes the account t'pe. Jor e-a.ple1
3C 1 3epositor' Current +ccount
LN 1 Loan +ccount for No.e
PPP denotes ban6 code which is @1@ for the Flobal Corp ban6
QQQQ denotes branch code which varies fro. branch to branch
RRRR denotes the custo.er nu.ber which starts fro. $$$1 for a account t'pe in
a branch and incre.ents se?uentiall' b' 1

E>!t should not be possible to .odif' the account nu.ber at an' stage
E>+ccount nu.ber should be generated b' s'ste. in the ascending order
E>The s'ste. should record the na.e and address of the account holder as
these are .andator'
E>The .ini.u. a.ount to open an account is I1$$
E>,ach account holder gets a user na.e and password that he can use to login
on web interface for basic services
&. OP,7+T!OF OO 3,PO/!TO7Q +CCOUOT
a. 3eposit Cash
E>+ deposit should be for a .ini.u. a.ount of I1$
E>3eposit should be a .ultiple of I1$
E>Whenever a deposit is .adeB the updated balance should be .ade 6nown to
the account holder
E>There is no upper li.it for account balance in case of current and fi-ed deposit
account t'pes
E>/avings ban6 account have an upper li.it of I<$$B$$$ as account balance
E>Jor fi-ed depositor' accountB onl' one ti.e deposit is allowed
b. Withdraw Cash

Jor Current and /aving account t'pe
E>Cash can be withdrawn b' Che?ues and 3ebit Cards
E>Aini.u. a.ount of withdrawal is I1$
E>+ccount balance should never be less than I1$$ for saving account and I$ for
current account(Oo overdraft facilit' is available)
E>Whenever a withdrawal is .adeB the updated balance should be .ade 6nown
to the account holder
E>Withdrawals .a' be .ade fro. an' of the branches or through +TA outlets as
designated b' the ban6
E>With the ban6Hs debit cardB one can shop using onEline debit .odule and
charge to the account directl'
Jor Ji-ed deposit account t'pe
E>Withdrawal fro. an account will result in the closing of the account
E>On closing of fi-ed deposit account t'pe principle a.ount along with applicable
interest should be .ade available to the custo.er

c. Jund Transfer
E>Onl' intra ban6 fund transfer is allowed
E>,ach user has a .a-i.u. fund transfer li.it of I1$$$ per da'
E>Jund transfer will adhere to standard deposit and withdrawal rules
d. 7elated /ervices
E>3e.and draft re?uest
E>Password change re?uest
E>+ccount state.ent re?uest
E>7e?uest for che?ue boo6s
9. OP,7+T!OF OO LO+O +CCOUOT
3ifferent loan sche.es provided b' Flobal Corp ban6 are listed as follows1
i. ,ducation Loan
ii. Mehicle Loan
iii. Nouse :uilding Loan
iv. :usiness Loan
v. +griculture Loan
vi. Consu.er ,lectronics Loan
E>Aini.u. a.ountB .a-i.u. a.ountB ter. of loanB rate of interest and
re?uire.ent of .ortgage depends upon the repa'.ent capabilit' of the applicant
E>:an6 will provide loans to its account holders charging a higher rate of interest
than that given b' the ban6 to saving and current account custo.ers
;. CLO/!OF +O +CCOUOT
E>:efore closing an accountB the account balance should be Gero
E>The status of the account will be set to 0closed0
E>+ll accounts that have not been operated for 1$ 'ears will be considered as
dor.ant account
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
The design docu.ent .entions that the +ccount class contains the te.plate for
creating an account and the specific features are i.ple.ented in the various t'pes of
account classes. + software engineer tries to create an object of the +ccount class
within one of the .ethods of the Custo.er class but is unable to do so and gets an
error. What could be the .ost probable reason for this
Options
a) The +ccount class is declared as a private class
b) The +ccount class cannot be inherited the object be .ade
c) +n object of +ccount class cannot be .ade in another class e-cept the class that
contains .ain
d) +ccount class is designed to be an abstract class answer1 d
1& Case /tud'
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Flobal Corp :an6 is a global ban6ing organiGation that provides standard ban6ing
services to its custo.ers spread across the globe. The vision of the ban6 is H:an6ing
/i.plifiedH. The head office is located in Chicago and the ban6 has presence in .ore
than 9$ countries with client base of nearl' >$$B$$$. The ban6 has several branches
in different cities% each branch is identified b' a ; digit code.
Flobal Corp :an6 is well 6nown a.ong its clients for worldEclass processesB speed of
e-ecution and financial acu.en. The ban6 has .ade a proposal for investing around
I&$$ .illion in settingEup &;-@ ban6ing support facilities for the custo.ers. The ai.
of the proposed ban6ing s'ste. is to create a paperless ban6. The ban6 leverages !T
for auto.ating several of its business processes which includes1
Aanaging Custo.er +ccounts
Transaction Aanage.ent
The account holders are provided with a webEbased interface for the following basic
services1
Chec6ing +ccount :alance
Jund transfer
Changing the account password
7e?uest for de.and draft andKor Che?ue :oo6s
Proble. /tate.ent1
Over the last couple of 'ears the reach of Flobal Corp has grown significantl'. !t has
seen a radical rise in the nu.ber of clients and transactions. 7ecentl' the ban6 has
also witnessed a dra.atic increase in co.petition fro. other financial institutions.
This .ar6et situation has pro.pted Flobal Corp to introduce new efficientB reliable
and scalable operational .ethodologies.
Junctional /pecifications1
Flobal Corp ban6 provides following account services1
1. 3epositor' +ccounts
a. Current account
b. Ji-ed deposit account
c. /avings ban6 account
&. Loan +ccounts
a. ,ducation Loan
b. Mehicle Loan
c. Nouse :uilding Loan
d. :usiness Loan
e. +griculture Loan
f. Consu.er ,lectronics Loan
7elated functionalities for the account services1
1. Opening an account
&. Operating on depositor' account
a. 3eposit cash
b. Withdraw cash
c. Jund Transfer
d. 7elated /ervices
9. Operating on loans account
;. Closing an account
1. OP,O!OF +O +CCOUOT
,ach new opened account should have a 19 character uni?ue account nu.ber.
The account nu.ber should be in the following for.at1
CCPPPQQQQRRRR
NereB
CC denotes the account t'pe. Jor e-a.ple1
3C 1 3epositor' Current +ccount
LN 1 Loan +ccount for No.e
PPP denotes ban6 code which is @1@ for the Flobal Corp ban6
QQQQ denotes branch code which varies fro. branch to branch
RRRR denotes the custo.er nu.ber which starts fro. $$$1 for a account t'pe in
a branch and incre.ents se?uentiall' b' 1

E>!t should not be possible to .odif' the account nu.ber at an' stage
E>+ccount nu.ber should be generated b' s'ste. in the ascending order
E>The s'ste. should record the na.e and address of the account holder as
these are .andator'
E>The .ini.u. a.ount to open an account is I1$$
E>,ach account holder gets a user na.e and password that he can use to login
on web interface for basic services
&. OP,7+T!OF OO 3,PO/!TO7Q +CCOUOT
a. 3eposit Cash
E>+ deposit should be for a .ini.u. a.ount of I1$
E>3eposit should be a .ultiple of I1$
E>Whenever a deposit is .adeB the updated balance should be .ade 6nown to
the account holder
E>There is no upper li.it for account balance in case of current and fi-ed deposit
account t'pes
E>/avings ban6 account have an upper li.it of I<$$B$$$ as account balance
E>Jor fi-ed depositor' accountB onl' one ti.e deposit is allowed
b. Withdraw Cash

Jor Current and /aving account t'pe
E>Cash can be withdrawn b' Che?ues and 3ebit Cards
E>Aini.u. a.ount of withdrawal is I1$
E>+ccount balance should never be less than I1$$ for saving account and I$ for
current account(Oo overdraft facilit' is available)
E>Whenever a withdrawal is .adeB the updated balance should be .ade 6nown
to the account holder
E>Withdrawals .a' be .ade fro. an' of the branches or through +TA outlets as
designated b' the ban6
E>With the ban6Hs debit cardB one can shop using onEline debit .odule and
charge to the account directl'
Jor Ji-ed deposit account t'pe
E>Withdrawal fro. an account will result in the closing of the account
E>On closing of fi-ed deposit account t'pe principle a.ount along with applicable
interest should be .ade available to the custo.er

c. Jund Transfer
E>Onl' intra ban6 fund transfer is allowed
E>,ach user has a .a-i.u. fund transfer li.it of I1$$$ per da'
E>Jund transfer will adhere to standard deposit and withdrawal rules
d. 7elated /ervices
E>3e.and draft re?uest
E>Password change re?uest
E>+ccount state.ent re?uest
E>7e?uest for che?ue boo6s
9. OP,7+T!OF OO LO+O +CCOUOT
3ifferent loan sche.es provided b' Flobal Corp ban6 are listed as follows1
i. ,ducation Loan
ii. Mehicle Loan
iii. Nouse :uilding Loan
iv. :usiness Loan
v. +griculture Loan
vi. Consu.er ,lectronics Loan
E>Aini.u. a.ountB .a-i.u. a.ountB ter. of loanB rate of interest and
re?uire.ent of .ortgage depends upon the repa'.ent capabilit' of the applicant
E>:an6 will provide loans to its account holders charging a higher rate of interest
than that given b' the ban6 to saving and current account custo.ers
;. CLO/!OF +O +CCOUOT
E>:efore closing an accountB the account balance should be Gero
E>The status of the account will be set to 0closed0
E>+ll accounts that have not been operated for 1$ 'ears will be considered as
dor.ant account
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
The +ccount class contains the +ccount nu.ber. The +ccount nu.ber is generated
b' a function generate+ccountOu.ber() in the +ccount class. This variable should
be .odified b' classes within the pac6age of the +ccount class and b' the child
classes of +ccount classes in a different pac6age. What would be the .ost
appropriate access specifier for this variable
Options
a)default b) private
c) protected answer1c
19 Which of the following isKare T7U, with respect to static 6e'word
(i)static variables can be accessed b' nonEstatic .ethods in the class
(ii)static variables can be accessed onl' b' static .ethods in the class
(iii)static .e.bers can be accessed with object or class reference
(iv)static .e.bers are accessed onl' with class reference
Options
a) Options (ii) and (iv) onl' b) Options (i) and (iv) onl'
c) Options (i) and (iii) onl' d) Onl' (i) answer1c
1; . What is the output of the following code snippet
public class Custo.ers "
static int count%
/tring na.e%
Custo.ers(/tring na.e)"
count22%
this.na.e#na.e%
/'ste..out.println(0The nu.ber of Custo.ers102count)%
*
public static void .ain(/tring45 args) "
Custo.ers custo.er1#new Custo.ers(0/he6ar0)%
Custo.ers custo.er&#new Custo.ers(0+.it0)%
*
*
Options
a) The nu.ber of Custo.ers1 1
The nu.ber of Custo.ers1 1
b) The nu.ber of Custo.ers1 $
The nu.ber of Custo.ers1 1
c) The nu.ber of Custo.ers1 1
The nu.ber of Custo.ers1 & answer1 c
1< . What is the output of the following code snippet
class /tudent "
double .ar6s%
/tudent()"
/'ste..out.println(0!n 3efault Constructor0)%
this..ar6s#<D.$%
/'ste..out.println(this..ar6s)%
*
/tudent(/tring t'pe)"
/'ste..out.println(0!n 02t'pe2 0 Constructor0)%
this..ar6s#1$$.$%
/'ste..out.println(this..ar6s)%
*
/tudent(double .ar6s)"
/'ste..out.println(0!n 3ouble Constructor0)%
this..ar6s#>V.$%
/'ste..out.println(this..ar6s)%
*
public static void .ain(/tring45 args) "
/tudent students1#new /tudent(03ouble0)%
*
*
Options
a) !n 3efault Constructor
<D.$
b) !n 3ouble Constructor
1$$.$
c) !n 3ouble Constructor
>V.$ answer1b
1> . What is the output of the following code snippet
public class College"
int 'ear%
/tring na.e%
College(int 'earB/tring na.e)"
'ear#'ear%
na.e#na.e%
*
public static void .ain(/tring45 args) "
College first#new College(1VVDB0:!T/0)%
/'ste..out.println(0The 'ear is102first.'ear)%
/'ste..out.println(0The na.e is102first.na.e)%
*
*
Options
a) The 'ear is1 null
The 'ear is1 null
b) The 'ear is1 1VVD
The 'ear is1 :!T/
c) The 'ear is1 $
The 'ear is1 :!T/
d) The 'ear is1 $
The 'ear is1 null answer1d
1@ . Which of the following is T7U, with respect to reference variables
(i) Printing a reference will OOT print the address of the object
referred b' it
(ii) Printing a reference will print the address of the object
referred b' it
(iii) U operator C+OOOT be used on reference variables to print
their address
(iv) U operator can be used on reference variables to print their
address
Options answer1&
a) Options (i) U (iv) onl' b) Options (i) U (iii) onl'
c) Options (ii) U (iii) onl' d) Options (ii) U (iv) onl'
1D . What is the output of following code snippet
class One
"
One()
"
/'ste..out.println(0One0)%
*
*
class Two e-tends One
"
Two(/tring .sg)
"
/'ste..out.println(.sg)%
*
*
class Three e-tends Two
"
/tring .sg # 0Three0%
Three(/tring .sg)
"
super(.sg)%
/'ste..out.println(this..sg)%
*
*
class 3e.o
"
public static void .ain(/tring args45)
"
Three obj # new Three(0Two0)%
*
*
Options
a) Two
Three
b) One
Three
Two
c) Three
Two
d) One
Two
Three answer1 d
1V . Consider the following scenario1
+ pac6age pac61 is created alongwith a class :ase inside the pac6age
+ pac6age pac6& is created with a class 3erived . This class e-tends the class :ase
in pac61 pac6age
Choose fro. a.ong the access specifier of variables in class :ase which would
OOT be accessible in the class 3erived.
Options
a) public specifier b) default specifier
c) protected specifier answer1 b
&$ . Consider the following scenario1
+ pac6age pac61 is created alongwith a class :ase inside the pac6age
+ pac6age pac6& is created with a class 3erived . This class e-tends the class :ase
in pac61 pac6age
Choose fro. a.ong the access specifier of variables in class :ase which would
OOT be accessible in the class 3erived.
Options
a) int baseAtd(int iOu.B char cMal)
"
return $%
*
b) void baseAtd(char cMalB int iOu.)
"
*
c) void overload :aseAtd(int iOu.B char cMal)
"
*
d) void baseAtd(int ildB char c/tatus)
"
* answer1b
&1 . The following code is giving co.pilation errors.
1 public class Suestion "
& public static void .ain(/tring45 args) "
9 float floatMarBanotherJloatMar#9%
; int resultBintMar#9%
< floatMar# (float)intMar2anotherJloatMar%
> result#intMar8anotherJloatMar%
@ /'ste..out.println(0The result is 02result)%
D *
V *
Choose the line which gives the error and a suitable replace.ent so that the output
of the progra. is The result is V
Options answer1 b
a) 7eplace line > with1 (float)result#intMar8anotherJloatMar%
b) 7eplace line > with1 result# intMar8(int)anotherJloatMar%
c) 7eplace line > with1 result# (int)intMar8anotherJloatMar%
d) 7eplace line < with1 floatMar# (int)(intMar2anotherJloatMar)%
&& . What is the output of the following code snippet
public class Suestion "
public static void .ain(/tring45 args) "
int counter # <$%
boolean val# true%
while (val)
"
if (counter C &$ UU counter>1$)
"
continue%
*
if (counter C 9$)
"
brea6%
*
counter # counter E 1$%
*
/'ste..out.println(0Malue is1 0 2 counter)%
*
*
Options answer1 d
a) Co.pilation error1 !ncorrect if state.ent
b) Oo output because it goes into an infinite loop
c) Co.pilation error1 ,--pected else WifX d) Malue is1 &$
&9 . What is the output of the following code snippet
public class Suestion "
public static void .ain(/tring45 args) "
int var # &&B anotherMar # @B result%
/tring str # 0One0%
/tring another/tr # 0Two0%
result # var8anotherMarKanotherMar%
if ( result C &&)
"
/'ste..out.println(str)%
result # result21%
*
else
"
/'ste..out.println(another/tr)%
result # var 2 anotherMar%
*
*
*
Options
a) one b) Two
c) Oone of the given options
d) Co.pilationerror1 incorrect use of operators answer1 b
&; . Which of the following is a M+L!3 variable declaration as per java coding standards
that 'ou have studied for storing an e.plo'ee na.e
Options
a) ,APna.e b),APO+A,
c) ,.pOa.e d) e.pOa.e answer1 d
&< . Which of the following is OOT a pri.itive data t'pe
Options
a) /tring b)int
c) double d) b'te answer1 a

Vous aimerez peut-être aussi