Posts

Showing posts with the label abstract class java

Abstraction in Java जावा में एब्सट्रेक्शन, Abstract Class in Java जावा में एब्सट्रेक्ट क्लास

Abstraction in Java is a process of hiding unnecessary implementation details and showing only essential features of an object. It helps in focusing on what an object does rather than how it does it. जावा में एब्सट्रेक्शन वह प्रक्रिया है जिसमें किसी वस्तु के केवल आवश्यक गुणों को प्रदर्शित किया जाता है और अनावश्यक विवरणों को छुपाया जाता है। इससे हम यह जान पाते हैं कि कोई वस्तु क्या करती है, न कि कैसे करती है। Java provides two ways to achieve abstraction: जावा में एब्सट्रेक्शन प्राप्त करने के दो मुख्य तरीके हैं: a) Using Abstract Classes b) Using Interfaces Abstract Class in Java An abstract class is declared using the abstract keyword. It can contain both abstract methods (without body) and concrete methods (with body). एब्सट्रेक्ट क्लास वह होती है जिसे abstract कीवर्ड के साथ घोषित किया जाता है। इसमें सामान्य (concrete) और एब्सट्रेक्ट दोनों प्रकार की मेथड्स हो सकती हैं। You can achieve 0% to 100% abstraction using an abstract class, depending on how many methods are ab...