April 2016
Intermediate to advanced
256 pages
4h 57m
English
Let's take an example of the childhood game Mario to understand OOPs. The following class shows some basic information about Mario and its capabilities:
public class Mario {
public void ability(){
System.debug('I can Walk');
}
public void info(){
System.debug('I am Mario');
}
}
This ability to bind the capabilities of Mario in the same place is called encapsulation.
Like any other games, there are power boosters, such as speed running, bullets, and so on. If we want to change the behavior of Mario in the game, some more code can be added to the existing class with conditions. However, the chances are high that an existing application will break due to the introduction of the new code. OOP suggests that you do not modify the existing ...
Read now
Unlock full access