permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in Cohesion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in Cohesion" Watch "Doubt in Cohesion" New topic
Author

Doubt in Cohesion

vijay basky
Greenhorn

Joined: Feb 05, 2012
Posts: 18

class Employee
---- maintainEmployeeInfo()
---- connectToRDBMS()

class Payroll
---- setStateTaxCodes()
---- findEmployeesByState()

class Utilities
---- getNetworkPrinter()

Assuming the class and method names provide good definitions of their own functionalities,
which are probably true? (Choose all that apply.)

A. These classes appear to have low cohesion.

B. These classes appear to have high cohesion.

C. These classes appear to have weak validation.

D. These classes appear to have strong validation.

E. These classes appear to have weak encapsulation.

F. These classes appear to have strong encapsulation.



for this question the answer is A,E
but i doubt on answer E
encapsulation is based on how instance variables are binded within instance method in class by making instance variable as private & method as public
please anyone help me to clarify this
thanks in advance

[Devaka: edited to make to question readable]
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3028
    
  35

Please QuoteYourSources


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Encapsulation also means binding the methods with the data they operate on. With that in mind, do you think the method findEmployeesByState belongs in Payroll? Or connectToRDBMS in Employee?
vijay basky
Greenhorn

Joined: Feb 05, 2012
Posts: 18

James Boswell wrote:Encapsulation also means binding the methods with the data they operate on. With that in mind, do you think the method findEmployeesByState belongs in Payroll? Or connectToRDBMS in Employee?


thanks for the reply man. now i understand
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt in Cohesion
 
Similar Threads
Doubt
Doubt
a doubt
Doubt
doubt on uCertify question