Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrapper classes, boxing and autoboxing  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Friends

I have so confusion on the following topics please help me on these--

Problems are---


1.What is coupling and cohesion? I know definition only I cud not understand basically how to use them in coding?
2.I have lots of confusion in wrapper classes and Boxing, Auto boxing?
3.Array reference assignment?
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aarti,

I'll take the item number 1.

Coupling and Cohesion are things to keep in mind when designing your code.
Just to review the definitions:

--
Coupling - The OO principle most closely associated to making sure that classes know about other classes ONLY through their APIs.

So coupling involves one or more classes interacting with one another. You only want to interact with another class through it's public API. If classes are written using good encapsulation - it should be easy to write code with loose coupling.

--
Cohesion - The OO principle most closely associated with making sure that a class is designed with a single well-focused purpose.

This just means that a class shouldn't do *everything* it should stick to one purpose. Represent one "thing".
--

Hope that helps!

Richard.
 
aarti gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Richard Parker

Thanks for fast reply.

Please, solve also my 2nd and 3rd problems.
 
Richard Parker
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you be more specific with problems 2 and 3?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!