RadhaKrishna
Replies to this thread:

More by RadhaKrishna
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 benefits of proper inheritance

[Please view other pages to see the rest of the postings. Total posts: 27]
PAGE:   1 2 NEXT PAGE
[VIEWED 22224 TIMES]
SAVE! for ease of future access.
The postings in this thread span 2 pages, View Last 20 replies.
Posted on 11-12-15 2:23 AM     [Snapshot: 100]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

COPIED FROM GOOGLE SEARCH:

Inheritance Advantages and Disadvantages

Advantages:-

One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be refactored to move the common code up to a mutual superclass. This also tends to result in a better organization of code and smaller, simpler compilation units.

Inheritance can also make application code more flexible to change because classes that inherit from a common superclass can be used interchangeably. If the return type of a method is superclass

Reusability -- facility to use public methods of base class without rewriting the same
Extensibility -- extending the base class logic as per business logic of the derived class
Data hiding -- base class can decide to keep some data private so that it cannot be altered by the derived class

Overriding--With inheritance, we will be able to override the methods of the base class so that meaningful implementation of the base class method can be designed in the derived class.

Disadvantages:-

1.One of the main disadvantages of inheritance in Java (the same in other object-oriented languages) is the increased time/effort it takes the program to jump through all the levels of overloaded classes. If a given class has ten levels of abstraction above it, then it will essentially take ten jumps to run through a function defined in each of those classes

2.Main disadvantage of using inheritance is that the two classes (base and inherited class) get tightly coupled.
This means one cannot be used independent of each other.

3. Also with time, during maintenance adding new features both base as well as derived classes are required to be changed. If a method signature is changed then we will be affected in both cases (inheritance & composition)

4. If a method is deleted in the "super class" or aggregate, then we will have to re-factor in case of using that method.Here things can get a bit complicated in case of inheritance because our programs will still compile, but the methods of the subclass will no longer be overriding superclass methods. These methods will become independent methods in their own right.


Inheritance offers the following advantages --
Developement model closer to real life object model with hierarchical relationships
Reusability -- facility to use public methods of base class without rewriting the same
Extensibility -- extending the base class logic as per business logic of the derived class
Data hiding -- base class can decide to keep some data private so that it cannot be altered by the derived class
 
Posted on 11-12-15 11:51 AM     [Snapshot: 201]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thanks RadhaKrishna
 
Posted on 11-12-15 2:28 PM     [Snapshot: 250]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Kati arulai dukh din janeko yo cp21 le, Google gareko bhaye bhai halthyo ni. Ma pani stupid nai ho yo comment lekhera time waste gardai chu as Radhakrishna wasted his time to google it for you and pasted it here.
 
Posted on 11-12-15 3:10 PM     [Snapshot: 269]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I'm simply asking to get better understanding from working professionals. Is this not a legitimate question? Do I need to ask for your permission prior to posting a question which is absolutely and completely valid within the realm of computer and IT forum? Seriously, stop making smart ass comments and continue to scroll through page.

Incompetent idiot without a life, go find something better to do with your life...
 
Posted on 11-12-15 5:09 PM     [Snapshot: 311]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Wow, hera na yo cp21 lai kati ris uthya?? Tero gali khanu raixa, dinai bigaris mero!!
 
Posted on 11-13-15 2:25 AM     [Snapshot: 375]     Reply [Subscribe]
Login in to Rate this Post:     2       ?     Liked by
 

hahaha.. nice Pharsi...!!! tara pani Chandra Prakash bhai, risaai haalnu parne kehi thiena, ani gaali garnu, ya mukh 6aadnu ta pattakkai euta professional lai suwaaudaina... say sorry to Pharsi, if you really care about the suggestion we give, and if you are really an aspiring professional in the field of IT...

 
Posted on 11-13-15 9:09 AM     [Snapshot: 420]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

WTF is wrong with these idiots. The purpose of this forum is to post questions regarding computer and IT.

Seriously, are y'all like going through the stage of mental retardation or just born dumb?

Tero bau ko ta kei khaideko chaina. kina yo forum ma ayera mero bheja khanchass
 
Posted on 11-13-15 10:57 AM     [Snapshot: 451]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

hey cp21,
You have shown that what level you belong to. Ma gaye jati gali garnu xa gara.
 
Posted on 11-13-15 1:46 PM     [Snapshot: 506]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 
 
Posted on 11-13-15 1:49 PM     [Snapshot: 507]     Reply [Subscribe]
Login in to Rate this Post:     2       ?     Liked by
 

कस्तो काम नै न लाग्ने, लंगड, खाते, अमर्यादित, अपरिपक्क, अबास्ताबिक, अहंकारी, अहम्मी, रिसा स्वभाव को मान्छे रहेछौ तिमि त चन्द्र प्रकास भाइ !
त्यसरी मुख छाडेर के नै पाउछौ र तिमि ले... हामि सबै ले तिम्रो मजाक बनाएको हैन के! मात्र यो चाहन्छौ कि तिमि आफु मेहेनत गर ! देश छाडेर परदेश मा आएको छौ, केहि आफ्नै बल बाट गर पो भन्न खोजेको हो भाइ !मुख छाडेर के नै पाउछौ, झन् तिमि लाइ अझ अरु ले पनि चिडयाउन थाल्छ तिम्रो comments देखेर अनि पढेर !
हेल्प पनि माग्छौ है अनि कसैले केहि प्रतिक्रिया दिने बित्तिकै खलासी, कुल्ली अनि कबाडी ले बोल्ने सब्द ले बोल्छौ अनि गालि गर्छौ ! त्यो त भएन नि भाइ ! जसरि तिमि ले साझा प्रयोग गरेको छौ, त्यस्तै हो हामि ले पनि प्रयोग गर्ने, जसरि तिमि प्रश्न राक्छौ, त्यसरी नै हामि ले पनि तिम्रो प्रश्न मा प्रतिक्रिया दिन पाउछौ के भाइ !
न रिसाउ, रिस ले तिम्रो नै रक्त चाप बढ्ने हो, हाम्रो त के नै हुञ्छ र तिमि रिसाउदा!
कत्ति पटक मैले तिम्रो प्रश्न को उत्तर दिएको छु, आझ आफु मेहेनत गर न भाइ भन्दा गालि गर्नु पर्ने त केहि थिएन त भाइ ! त्यै गालि गरेको मा यो thank you note तिमि लै है त ! Have a great weekend Bhai ! Sorry if I was trying to be your Hero, which I know, I am not.
 
Posted on 11-13-15 2:19 PM     [Snapshot: 539]     Reply [Subscribe]
Login in to Rate this Post:     2       ?     Liked by
 

cp21, People are trying to help you out but you are proving yourself an idiot with your comments. Bro, you need to put an effort from your side as well to learn CS concepts and programming. The way you are asking simple questions without enough studying is just irritating. And, this is coming from a CS student myself . It will be on your benefit if you study the material first and may be watch some youtube videos.
 
Posted on 11-13-15 2:24 PM     [Snapshot: 552]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Does it hurt anyone if I POST a FUKING QUESTION?

If you don't want to respond, then mind your FUkING business.... Whoa these idiots keep piling up... OMG what is up with these idiots... I have done all my studying as, but I want people to share their perspective on given topic.

Lastly, I'm not your bro!


Last edited: 13-Nov-15 02:27 PM
Last edited: 13-Nov-15 02:28 PM

 
Posted on 11-13-15 2:37 PM     [Snapshot: 563]     Reply [Subscribe]
Login in to Rate this Post:     2       ?     Liked by
 

@ cp21:

Yes CP21, an idiot see everyone an idiot because he thinks he is the smartest person in the planet. So it makes sense to us when you time and again tells everyone of us idiot. And it is because you are the biggest dumb ass, idiot in this whole planet. Put your ass in the library and study.
Yes, you are nobody's bro because you do not deserve to be anyone's bro. You are just that cheap ass retarded bastard son of your mother who even does not who your father is so far.
This forum is not the property of yours... so make it clear and understandable that if you post any such stupid, lazy ass questions, you will get a backlash.
Now, be a quite kid! and go home and ask your mother who your father is... that you need to find first. Once you know who your father is, ask him to whip you ass. you need some manners, kid!
Also, stop using this site, this site is not for the person like you who misuse it. Moreover, it is NOT for kids like you.
 
Posted on 11-13-15 2:50 PM     [Snapshot: 572]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I feel sorry that your mother dropped you on your head when you were just 9 months old. Hence, a retarted little fuker who continues to lurk around this thread.

If you reply back then its a fact that you were dropped during birth.
 
Posted on 11-13-15 3:00 PM     [Snapshot: 590]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

@ cp21:

Since you started attacking an individual's character and personality, I am not going to leave you like this. You will get responses on every post you publish. Will try to always divert the topic you posted unless and until you SHUT your mouth up, util, you really start putting your ass on study, until you correct your mistakes and apologize to all publicly (Which I know you will never do. Coz, you do not have the guts, coz you are not a human).
You are the son of your whore momma who still is searching his father
 
Posted on 11-13-15 3:05 PM     [Snapshot: 597]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I rest my case!!! Poor little boy with his itty bitty microscopic penis.
 
Posted on 11-13-15 3:10 PM     [Snapshot: 608]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

@ cp21:

Ask your mother whose disk is microscopic...?? She will tell you about mine too... coz she really enjoyed that in her ass....
 
Posted on 11-13-15 4:16 PM     [Snapshot: 662]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

@cp21,
First of all, I am sorry if I initiated your anger. All I wanted to tell you was to put some efforts into it before you ask general questions whose answers can simply be found. If you don't find the solutions, then ask professionals so that we could find the solution together. Thats all I wanted to say.
@ Radhakrishna
Sorry Dai for initiating all this shits. I didn't mean it but it happened. Just chill chill!!

 
Posted on 11-13-15 4:38 PM     [Snapshot: 684]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

It is fine Pharsi.

This cp21 is just a piece of shit and fool. He needs to learn how to talk. Does not have any manner or respect for anyone. The person who does not respect others does not respect himself as well. He really needs medical help because he thinks he knows all and he can just bully anyone when somebody reacts to his dumb and lazy ass questions. It is absolutely not fair.

Well, I do not act like this mostly, I am not rude and inappropriate person, I apologize for all the rudeness and nonsense I am talking which might be offending/insulting to most of us...

BUT SOMEBODY TOLD ME THAT TO TEACH A FOOL A LESSON, YOU MUST ACT AS A FOOL YOURSELF... Because a fool only understand his own language, that is fool's language.
 
Posted on 11-13-15 4:43 PM     [Snapshot: 694]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

@RadhaKrishna
“Never argue with an idiot. They will only bring you down to their level and beat you with experience.”

I don't even know why you bother to copy paste from google and answer which he could have easily done.. just ignore bro!
 



PAGE:   1 2 NEXT PAGE
Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 365 days
Recommended Popular Threads Controvertial Threads
श्राद्द
TPS Re-registration
सेक्सी कविता - पार्ट २
What are your first memories of when Nepal Television Began?
पाप न साप घोप्टो पारि थाप !!
पुलिसनी संग - आज शनिवार - अन्तिम भाग
निगुरो थाहा छ ??
ChatSansar.com Naya Nepal Chat
Lets play Antakshari...........
What Happened to Dual Citizenship Bill
Basnet or Basnyat ??
TPS Re-registration case still pending ..
Sajha has turned into MAGATs nest
NRN card pros and cons?
is Rato Bangala school cheating?
मेरो अम्रिका यात्रा -२
Do nepalese really need TPS?
कता जादै छ नेपाली समाज ??
susta manasthiti lai ke bhanchan english ma?
कृष्ण नै अन्तिम सत्य
Nas and The Bokas: Coming to a Night Club near you
राजदरबार हत्या काण्ड बारे....
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
is Rato Bangala school cheating?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters