File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 2885
    
  13

Please QuoteYourSources


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
My Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Cohesion
 
Similar Threads
Doubt
Doubt
Doubt
a doubt
doubt on uCertify question