
Play Store Application link – https://play.google.com/store/apps/details?id=com.ideepro.java25hours
Learn with youtube video –
💡Definition-
Abstraction is a concept of showing only functionality and hiding procedure.
In java, only name of method is given and not the body.
-Abstraction can be applied on classes and methods using abstract keyword.
– In abstraction we focus on “what” the object does instead of “how”.
Quick comparison between abstract classes and abstract methods:-
| Feature | Abstract Class | Abstract Method |
|---|---|---|
| Definition | A class that cannot be instantiated and serves as a base for one or more derived classes. It may contain both abstract and concrete methods. | A method that has no implementation and must be implemented by a derived class. |
| Use | To provide a common interface and implementation for related classes. | To define a common interface for derived classes to implement. |
| Syntax | abstract class ClassName { ... } | abstract void MethodName(); |
| Can be declared in | Class | Class or interface |
| Can have concrete methods | Yes | No |
| Must be implemented in derived class | No | Yes |
💡1- abstract class
– Only abstract class can have abstract methods
-Abstract class can have normal methods too.
-Object of abstract class can’t be created directly
– abstract classes should be inherited to be useful

[Think of an abstract class as an almost complete car by your dad who left over the choice of engine to be provided by you.]
💡2- abstract method
– abstract method can’t have method body
– abstract methods should be overridden to be useful.
code samples are here
1- Abstraction
package abstraction14;
abstract class A{
abstract void shw();
abstract void disp();
}
public class ExampleAbstraction extends A {
@Override
void shw() {
System.out.println("hi");
}
@Override
void disp() {
System.out.println("bye");
}
public static void main(String[] args) {
ExampleAbstraction e1=new ExampleAbstraction();
e1.shw();
e1.disp();
}
}
Interview Questions —
- what is abstraction in real world?
- How to create object of abstract class?



















Để đảm bảo an toàn tối đa cho giao dịch, 188V áp dụng công nghệ mã hóa SSL 256-bit cùng hệ thống xác thực hai lớp (2FA) tùy chọn. Mỗi giao dịch đều được ghi nhận với mã tham chiếu duy nhất, giúp dễ dàng theo dõi và giải quyết vấn đề nếu có. TONY07-05
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
[…] with Code (8th Hour)Step 14: Java Polymorphism Explained – Easy OOP Guide with Code (9th Hour)Step 15: Java Abstraction Explained – Easy OOP Guide with Code (10th Hour)Step 16: Java Encapsulation Explained – Easy OOP Guide with Code (11th Hour)Step 17: this and […]