Difference Between Abstract Class and Interface Class In Hindi
यादातर interview question में यह रहेता ही है इसीलिए आज हम discuss करेंगे की Abstract Class and Interface Class में क्या difference है तो चलिए देखते हैं -
Abstract Class
1-abstract class में दोनों abstract method and concrete method allow होता है .
Ex-
abstract void Studentdetails{
abstract void Student1(); //Abstract Method
void Student2(){ //Concrete Method
}
}
2-इसमें किसी भी type का default cases नही होते हैं .
3-इसमें variables केलिए भी कुछ default cases नही होते हैं .
4-abstract class के अन्दर आप constructor ,static and non static blocks ,static and non static methods and static and non static variables को आप declare कर सकते हो .
5-abstract class में object creation नही होसकता है .
Interface Class
1-Interface class में only abstract method allow होते हैं .
Ex-
interface Studentdetails {
abstract void getStudentdetails();
abstract void setStudentdetails();
}
2-इसमें default cases होते हैं public and abstract .
3-इसमें variables by default public ,static and final होते हैं .
4-interface class में constructor ,static and non static blocks ,static methods declare नही कर सकते हैं .
5-interface के अन्दर native methods ,final methods ,stricft methods,synchronization methods declare नही कर सकते है .
6-private and protected modifiers interface में allow नही होते हैं .
7-interface class में object creation नही होसकता है .
आपको कुछ भी problem ही java से जुडी जानकारी से तो आप हमें comment section में comment कर सकते हैं .में अभी एक software developer हूँ मुझे पता है आपको कैसा पढना है .यह था आज का टॉपिक reserved keywords के बारे में .उम्मीद करता हूँ आप लोगो को यह आर्टिकल पसंद आया होगा यदि आया है .
तो आपके दोस्तों के साथ शेयर करें .
interface class and abstract class all details example of interface and abstract class all information and difference between abstract class and interface all in hindi
more article
0 Comments