1 2 Previous Next 16 Replies Latest reply: Dec 7, 2007 11:29 AM by 807603 RSS

    where we use abstract class & interface...

    807603
      In which situation we use abstract class & interface

      pls give me simple examples
        • 1. Re: where we use abstract class & interface...
          807603
          Congratulations!

          applause

          You are the one millionth person to ask this question on this forum. You are the lucky recipient of an all expenses paid luxury trip to....

          Google!

          more applause
          • 2. Re: where we use abstract class & interface...
            807603
            * marching band *
            * cheerleaders *
            * dwarves carrying silver platters piled high with cocaine *
            • 3. Re: where we use abstract class & interface...
              3004
              jsf_VWP5.5.1 wrote:
              In which situation we use abstract class & interface

              pls give me simple examples
              oo design usually follows the pattern of abstract design and concreate implementation. if the object you are designing has an abstract notion, use an abstract class to describe that notion, and then extend it for more concreate notions. for example, if you want to describe the notion of fruit, make it an abstract class, then you can extend it for more concreate things like apples, oranges, etc.

              interfaces are contracts among different entities so that all parties can interact smoothly according to the contracts/interfaces. for example if you provide an interface eatable to other people, and make your class eatable, then others know they can eat your object once they see that your object implements the eatable interface, they dont have to look into your implementation details.

              dont worry about the cutton george mcs, they are valoo chickens.
              • 4. Re: where we use abstract class & interface...
                807603
                valooCK wrote:
                jsf_VWP5.5.1 wrote:
                In which situation we use abstract class & interface

                pls give me simple examples
                oo design usually follows the pattern of abstract design and concreate implementation. if the object you are designing has an abstract notion, use an abstract class to describe that notion, and then extend it for more concreate notions. for example, if you want to describe the notion of fruit, make it an abstract class, then you can extend it for more concreate things like apples, oranges, etc.
                Why should fruit be an abstract class?
                interfaces are contracts among different entities so that all parties can interact smoothly according to the contracts/interfaces. for example if you provide an interface eatable to other people, and make your class eatable, then others know they can eat your object once they see that your object implements the eatable interface, they dont have to look into your implementation details.

                dont worry about the cutton george mcs, they are valoo chickens.
                "valoo chicken" being a word you made up to define "people who are not me". Why not stick to the patterns forum, where you can make a t!t of yourself with relatively little impact on others?
                • 5. Re: where we use abstract class & interface...
                  3004
                  >
                  Why should fruit be an abstract class?
                  you must try it in order to know it:) you have to use an abstract class, you can not do it in a regular class. try it:)
                  • 6. Re: where we use abstract class & interface...
                    807603
                    valooCK wrote:
                    >
                    Why should fruit be an abstract class?
                    you must try it in order to know it:) you have to use an abstract class, you can not do it in a regular class. try it:)
                    Meaningless garbage. Why can fruit not be an interface, for example? What can you do with an abstract class that you can't do with a concrete class, and how do you see that being relevant to "fruit"?
                    • 7. Re: where we use abstract class & interface...
                      3004
                      georgemc wrote:
                      valooCK wrote:
                      >
                      Why should fruit be an abstract class?
                      you must try it in order to know it:) you have to use an abstract class, you can not do it in a regular class. try it:)
                      Meaningless garbage. Why can fruit not be an interface, for example? What can you do with an abstract class that you can't do with a concrete class, and how do you see that being relevant to "fruit"?
                      technically, interfaces and abstracts are quite the same, their differences are mostly in where they are used. an interface exposes a special interface for contracting purposes. a class that implements it can have a smaller or bigger or exactly the same interface. an abstract class however, represents an abstract notion. fruit, number, food are some examples of abstract notions in real life. they do not exist. they can only be represented partially by a concreate example. an apple, an orange etc can represnt the abstract notion of fruit. the number 1, 2,3 etc can represent the notion of number. but neither number nor fruit actually exists. an abstract class is designed for that purpose, functionally better than an interface for this purpose, although technically an interface works as well.

                      by the way, were you verdy?
                      • 8. Re: where we use abstract class & interface...
                        807603
                        valooCK wrote:
                        georgemc wrote:
                        valooCK wrote:
                        >
                        Why should fruit be an abstract class?
                        you must try it in order to know it:) you have to use an abstract class, you can not do it in a regular class. try it:)
                        Meaningless garbage. Why can fruit not be an interface, for example? What can you do with an abstract class that you can't do with a concrete class, and how do you see that being relevant to "fruit"?
                        technically, interfaces and abstracts are quite the same, their differences are mostly in where they are used. an interface exposes a special interface for contracting purposes. a class that implements it can have a smaller or bigger or exactly the same interface. an abstract class however, represents an abstract notion. fruit, number, food are some examples of abstract notions in real life. they do not exist. they can only be represented partially by a concreate example. an apple, an orange etc can represnt the abstract notion of fruit. the number 1, 2,3 etc can represent the notion of number. but neither number nor fruit actually exists. an abstract class is designed for that purpose, functionally better than an interface for this purpose, although technically an interface works as well.
                        So you've changed your meaning retroactively then? Stop babbling, man, "abstracts" means nothing in this context, you mean "abstract class", which somewhat changes the above. Attempt at back-pedalling failed, I'm afraid. An abstract notion isn't necessarily best modelled as an abstract class. Attempt at re-defining words to fit your own argument failed
                        by the way, were you verdy?
                        Nope. His other account is vanilla lorax. We do have some similar traits, though
                        • 9. Re: where we use abstract class & interface...
                          807603
                          Dear ValooChickens,

                          When is the next installment in your video series going to be available? We are eagerly awaiting part two of the valoo chicken village.

                          Our review so far

                          Overall, a little short however an excellent soundtrack. The production values are surprisingly good as well, especially considering the source. The biggest complaint from long time fans of the serial novel who have been waiting for the movie version for years now is that in production the hero (you) seem to have been rewritten as someone who can now spell. I mean there is only one glaring error and several of the sentences are actually coherent. Big let down. This detracts from the humour value and also frankly just doesn't jive with the daFei we have come to know and love from your incoherent ramblings on here.

                          If you have no idea what I am talking about http://www.youtube.com/ValooChickenVillage
                          • 10. Re: where we use abstract class & interface...
                            807603
                            jsf_VWP5.5.1,

                            I'm not going to bother answering your question, since, as already pointed out, it's asked frequently here and can easily be answered by a simple google search. However, I will give you a piece of advice: Ignore everything valooCK says. He is a known troll who deliberately posts idiocies simply to satisfy some sad, sick need he has. Ignore every word he says.
                            • 11. Re: where we use abstract class & interface...
                              3004
                              cotton.m wrote:
                              Dear ValooChickens,

                              When is the next installment in your video series going to be available? We are eagerly awaiting part two of the valoo chicken village.

                              Our review so far

                              Overall, a little short however an excellent soundtrack. The production values are surprisingly good as well, especially considering the source. The biggest complaint from long time fans of the serial novel who have been waiting for the movie version for years now is that in production the hero (you) seem to have been rewritten as someone who can now spell. I mean there is only one glaring error and several of the sentences are actually coherent. Big let down. This detracts from the humour value and also frankly just doesn't jive with the daFei we have come to know and love from your incoherent ramblings on here.

                              If you have no idea what I am talking about http://www.youtube.com/ValooChickenVillage
                              thanks for the review. the real thing is coming soon. all i need is spend some more money on a good editing program. i will start with the start of the internet, and come right to pass by valoo, and the naked bodies of jschell, verdy, etc. bloody scenes. be prepared. no mercy.

                              oh, your contributions are very welcome. just send me a message.

                              Edited by: valooCK on Dec 7, 2007 1:12 PM
                              • 12. Re: where we use abstract class & interface...
                                jschellSomeoneStoleMyAlias
                                valooCK said
                                thanks for the review. the real thing is coming soon. all i need is spend some more money on a good editing program. i will start with the start of the internet, and come right to pass by valoo, and the naked bodies of jschell, verdy, etc. bloody scenes. be prepared. no mercy.
                                For current and future readers please note that one should ignore anything said by valooCK. There is extensive proof that he does not know what he is talking about - ever. And there are indications, such as the above posting, that suggests that he has some non-trivial psychological problems (literally rather than figuratively.)
                                • 13. Re: where we use abstract class & interface...
                                  807603
                                  cotton.m wrote:
                                  If you have no idea what I am talking about http://www.youtube.com/ValooChickenVillage
                                  What.
                                  The.
                                  Holy.
                                  Hell.
                                  • 14. Re: where we use abstract class & interface...
                                    807603
                                    jschell wrote:
                                    valooCK said
                                    thanks for the review. the real thing is coming soon. all i need is spend some more money on a good editing program. i will start with the start of the internet, and come right to pass by valoo, and the naked bodies of jschell, verdy, etc. bloody scenes. be prepared. no mercy.
                                    For current and future readers please note that one should ignore anything said by valooCK. There is extensive proof that he does not know what he is talking about - ever. And there are indications, such as the above posting, that suggests that he has some non-trivial psychological problems (literally rather than figuratively.)
                                    Food for thought: If daFei is encouraged to make his videos then he might spend more time doing that and less time on, you know, messing about in the Designs and Patterns forum.
                                    1 2 Previous Next