Eventsku

Eventsku

Subscribe to RSS feed

Encapsulation For eventsku

eventsku

Encapsulation
Some programming languages, and even Java if you insist, allow you to go eventsku
ahead and address the instance variables yourself. Thus, after creating an http://greateventsupport.com/freehand/swatches-panel/system-requirements.html
instance of the Vehicle class, you could go in and directly change the weight
and speed variables yourself. This is a straightforward way to do things, but
unfortunately it has many drawbacks. One of the great things about
object-oriented programming is that it allows you to reuse objects without
worrying about the code that is contained within the object itself.
developer.com - Reference
file:///D|/Cool Stuff/old/ftp/Creating.Web.Applets.With.Java/cwa09fi.htm (5 von 24) [12.05.2000 14:54:11]
Suppose your program was using the Vehicle class, and the Vehicle class had http://greateventsupport.com/filezilla/local-file-list/menus-and-toolbars.html
been designed and implemented by someone else. It's quite possible that at
some point the designer of the class came to the conclusion that maybe an
integer isn't specific enough to hold the weight of many vehicles, but that a
special object for weight is needed that holds the unit of measurement
(pounds, tons, and so on) in addition to the number.
http://greateventsupport.com/freehand/installing-starting-freeHand.html
If you upgraded to the new version of Vehicle class and your program was eventsku
going into the object and directly modifying the weight, expecting an integer,
the compiler would generate an error. Encapsulation keeps this error from
happening. Encapsulation is the concept that objects should, in general, not be
able to change(or even look at directly) each other's instance variables. How
then do you get at those variables? Through methods, that's how.

objects, and things should get much clearer.

February 2012
M T W T F S S
January 2012March 2012
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29