This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 3060
    
  38

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Cohesion