Abstraction in Java by Deepak Smart Programming Lyst9128
Abstraction in Java by Deepak Smart Programming Lyst9128
Abstraction in Java
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
=> Data-Hiding :-
-> Data-Hiding is the process of hiding the data
from outside users
-> It is achieved by private access-modifier
-> Example :
class Account
{
1
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
=> Abstraction :-
-> Abstraction is hiding the details (hiding the
implementation part) and just highlight the main
services
-> Real world example : Car (internal working of
breaks, gears etc are hidden from user), Bank
(internal working of credit/debit is hided form user
2
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
------------------------------------------------------------
{
//concrete methods
void sum()
{
//coding
3
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
}
//abstract methods
abstract void show();
}
4
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
5
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
Interview Questions :-
1. What is difference between concrete methods and
abstract methods ?
-> Concrete Methods : which have both
declaration and implementation part
Abstract Methods : which have only
declaration part
-> Concrete Methods : we dont need to use any
keyword
6
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
7
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308
Websites: https://www.smartprogramming.in/
https://courses.smartprogramming.in
Android App:
https://play.google.com/store/apps/details?id=com.sma
rtprogramming
YouTube Channel:
https://www.youtube.com/c/SmartProgramming