Java switch:
switch executes one statement from multiple statements.
Java switch syntax:
switch(expression){
case v1:
//code to be executed;
break; //optional
Object Oriented Programming concepts:
What is class and Object?
→ Class and object is one of the important Object Oriented Programming concepts.
→ Class and object are base for most of the programming languages like Java, C++, and etc.
What is a class?
→ Class can related to a blue print.
→ We can relate with our school exam blue print.
→ It is a logical entity and not the physical entity.
→ It determines what an object should hold.
→ Example: Phone is a class, objects are Samsung Galaxy, Vivo V9, iPhone, and etc
→ Class properties can be price, screen size, battery capacity, OS type, and etc.
What is an object?
→ Object is a specimen of a class.
→ An object has its own properties and methods.
→ Any number of objects can be created using a class.
→ iPhone 8 properties are Price=60,000, Battery Capacity=1,821mAh, OS=ios 11
→ Vivo V9 Price= 17,000, Battery capacity=3260 OS=Android 8.1
What is an Inheritance?
→ Inheritance is one of the important Object Oriented Programming concepts.
→ It inherit the properties from something.
→ Object acquires the properties and behaviors of the parent object
→ Parent-Child relationship between two classes.
Advantages:
→ Reusability - can reduce duplication of the same code
→ Extensibility - extend the base class logic as per business
→ We can have custom logic of the derived class
→ Data hiding - base class can decide which properties
What is abstraction?
→ Exposing only the required things to the outside world while hiding the inner details
→ Hiding irrelevant details from the user
Advantages:
→ Abstraction makes the code as readable and more simpler. Because the complexity of code will be hidden.
→ It reduces the code because it hides the unnecessary things
Real-life Example:
→ We use Air-conditioner by switching on and off using remote but we don't care about the inner working mechanism of Air-Conditioner. We are only concerned about the final output.
What is Encapsulation?
→ Wrapping up of data and methods into a single unit.
→ To avoid the access of private data members from outside the class.
→ You can get a coco cola which is inside the machine only by inserting the coin in the vending machine. Here, Coco-Cola is the private data of that vending machine.
→ You can access that using the operations provided by that Vending machine class.
For more details & source code check out: https://www.programmingline.com/2019/...
#oopsconcepts #objectorientedprogramming #programmingline #rakesh #rake
*******************************************************
IMPORTANT PLAYLISTS:
Java Course: • Java tutorial
in Tamil | Java course...
Software Design Patterns Course: • Software Design Patterns in Tamil
OOPs Course: • OOPs concepts in Tamil | Object Orien...
NLP Course: • Natural Language Processing 101 in Tamil
Software Interview Tips: • Software Interview tips in Tamil
Important Links:
Skillshare - Best Online Learning Platform (2 Free Months of Premium Membership): https://programmingline.com/skillshare
Java Course: https://programmingline.com/java-course
Software Design Patterns Course: https://programmingline.com/software-...
Object Oriented Programming (OOPs) Course: https://programmingline.com/oops
Best Books for Software Courses: https://programmingline.com/best-book...
Campus Interview: https://programmingline.com/campus-in...
How to crack the programming aptitude round?: https://programmingline.com/how-to-cr...
*******************************************************
Subscribe my YouTube channels:
► Subscribe https://www.youtube.com/programmingli... channel for watching Software Related courses like Java, Software Design Patterns, OOPs, and etc in Tamil, Telugu, and English.
► Subscribe / @roadtoinvestment7954 channel for watching Income Tax saving schemes and Stock Market related videos.
► Subscribe / @rakesh-ms7tn channel for watching Terrace Gardening Tips, Unboxing products, and Random videos in Tamil, Telugu, and English.
Website: https://www.programmingline.com
FaceBook page: / programminglineofficial
Instagram: / programmingline
Twitter: / programmingline
*******************************************************