What is the benefit of abstract classes?

I am little bit confuse regarding the benefits of the abstract classes. Can anybody helps me in this regard. I just want to know when and what situation we may decide that particular class needs an abstract method.
Thanx

I am little bit confuse regarding the benefits of the
abstract classes. Can anybody helps me in this
regard. I just want to know when and what situation
we may decide that particular class needs an abstract
method.Sorry if I sound weary of this question, but it is asked about 3-4 times a week. Rather than have us go through this tired exercise again, please search the forum for previous threads on this subject. You'll find about a gazillion. In fact, it's often a good idea to search the forum before asking a question as very often it has been asked and answered before.

Similar Messages

  • What is the difference between Abstract class and Interface ?

    Hi,
    Could u plz tell me the difference between Abstract class and Interface?
    Thanks in advance.
    Gopi

    Lots.
    An abstract class can contain some method implementations, or indeed all the method implementations. It may contain methods with all the various access modifiers. It cannot be instantiated. A class may inherit from only a single abstract class.
    An interface contains only public method stubs and constants. A class may implement multiple interfaces. An interface cannot (obviously) be instantiated.
    Abstract classes are particularly useful when you need to provide a semi-complete implementation for reuse. Interfaces are used more like types.
    Look at java.util.* for some good examples of the use of both.

  • What is the advantage of abstract class and method???

    hi,
    * Why a class is declared as abstract???
    * What is the use of declaring a class as abstract???
    * At what situation abstract class will be used???Thanks
    JavaImran

    To save you from the wrath of the Java experts on this forum, allow me as a relatively new Java user to advise you: do NOT post homework problems here; you're just going to get told to go google the answer. Which would be a good move on your part. Especially since I found the answer to your questions by googling them myself.

  • What's the difference between Abstract Class and Interface?

    Dear all,
    Can anyone give me some hints about this topic?
    Thanks.
    Leo

    an abstract class may have some methods already implemented in the abstract class but an interface has no methods implemented
    I think it's just that simple.
    For your design needs, you just choose what you need : )
    Cheers
    Stephen

  • What is the Use of Abstraction

    What is the Use of Abstract class..
    Edited by: Deenu on Jul 1, 2008 11:11 PM

    Deenu wrote:
    What is the Use of Abstract class..It's highly effective in confounding lazy noobs.
    Instead of posting every question that pops into your mind and waiting for somebody to spoonfeed you the answer, you might find it useful to go through one or more tutorials or texts on Java. For instane, perhaps one or more of the following might be useful.
    Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • Why class builder allows to develop abstract final class ? What is the use of such class in ABAP?

    I am new to ABAP. I tried creating abstract class and found that class builder allows development of abstract final class. What is the use of such class in ABAP?

    Hi,
    Does not compile:
    This one do:
    Inheritance:
    Regards.

  • What is the use of Generic class in java

    hi everyone,
    i want to know that
    what is the use of Generic class in java ?
    regards,
    dhruvang

    Simplistically...
    A method is a block of code that makes some Objects in the block of code abstract (those abstract Objects are the parameters of the method). This allows us to reuse the method passing in different Objects (arguments) each time.
    In a similar way, Generics allows us to take a Class and make some of the types in the class abstract. (These types are the type parameters of the class). This allows us to reuse the class, passing in different types each time we use it.
    We write type parameters (when we declare) and type arguments (when we use) inside < >.
    For example the List class has a Type Parameter which makes the type of the things in the list become abstract.
    A List<String> is a list of Strings, it has a method "void add(String)" and a method "String get(int)".
    A List<File> is a list of Files, it has a method "void add(File)" and a method "File get(int)".
    List is just one class (interface actually but don't worry about that), but we can specify different type arguments which means the methods use this abstract type rather than a fixed concrete type in their declarations.
    Why?
    You spend a little more effort describing your types (List<String> instead of just List), and as a benefit, you, and anyone else who reads your code, and the compiler (which also reads your code) know more accurately the types of things. Because more detail is known, the compiler is able to tell you when you screw up (as opposed to finding out at runtime). And people understand your code better.
    Once you get used to them, its a bit like the difference between black and white TV, and colour TV. When you see code that doesn't specify the type parameters, you just get the feeling that you are missing out on something. When I see an API with List as a return type or argument type, I think "List of what?". When I see List<String>, I know much more about that parameter or return type.
    Bruce

  • What are the major components in class?

    1)     What is the purpose of ‘load-of-program’? When it will be trigger?
    2)     Write the code for displaying the three parameters in single line with the first parameter as mandatory in the selection screen?
    3)     Which event triggered whenever the user call the function BACK, EXIT, CANCEL?
    4)     What are the major components in class?
    5)     What is the functional module is used to get popup screen for ALV reports?
    6)     Which type of pool is used to get drop-down list?
    7)     What is the tcode for creating the variant truncations?
    8)     Is it possible to call LDB’s number of times in same report?
    9)     What are the conditions to use control break statements in our report program?
    10)     What is the use of range statement?
    11)     What is the difference between normal reports and alv reports? With comparing to normal report are there any disadvantages in alv reports?
    12)     What are the components used to suppress the fields in the selection-screen?
    13)     What is the standard program to transport selection screen variants?
    14)     What is the event keyword for defining event block for reporting events?
    15)     What is the specific statement use when writing a drill down report?
    16)     What are the different tools to report data in sap?
    17)     Write the menu path to create a selection text in reports?
    18)     How do we omit the leading zero s while formatting outputs in reports?
    19)     What are the report truncations?
    20)     How do we align selection input in single row?
    21)     How do we suppress the display of input fields on selection screen?

    this forum is not for answering your interview questions...if you stucked with any realtime problem then post...please try to respect forum terms and conditions.
    Thank you.

  • What is the difference between document class and normal class

    Hi,
    Please let me know what is the difference between document class and normal class.
    And I have no idea which class should call as document class or call as an object.
    Thanks
    -Actionscript Developer

    the document class is invoked immediately when your swf opens.  the document class must subclass the sprite or movieclip class.
    all other classes are invoked explicitly with code and need not subclass any other class.

  • What is the benefit of Using Data Adaptor

    Hello
    I wonder that What is the benefit of Using Data Adaptor ? I don't know TopLink Technology , inorder to using Data Adaptor I should know toplink but what is the advatages of using BPEL database adaptors in conditions thet I can make webservices by making plsql web services or exposing ADF application modules more easier?
    I think that if I use Data Adaptor (based of Toplink) I can use JTA feature for transaction managment , am I thinking Correct?
    for example I can invoke to webservice A and the B in BPEL process with two DB adaptores (by global transaction ) such that if A failes the process automatically roles back the B transaction without need that I manauly compensate the undo process
    please help me ?

    Thank you for your very useful comments about DB adapter
    I tried again and I have Successfully deploy and test my DB adapter with using # for parameter.
    But I have another question : We have ADF Application that using ADF bc for user data entry supporting in use case scenario , but we want to call web services (eg BPEL) in save operation instead of ADF application modules Normal commit !
    If we want using Data adapter for persist the Data that user entered by UI , we must write a lot of Insert or Update statements in DB adapter because of lot of database entities.
    How can we shorten this production scenario in our Project?

  • What is the use of valuation class in Finished Material Master?

    Dear Expert
    What is the use of valuation class in Finished Material Master?
    Thanks of Advance

    hi,
    this is to inform you that,
    generally 7920 - will be the valuation class for the finished goods.
    Allows the stock values of materials of the same material type to be posted to different G/L accounts & vice versa.
    this is an integration field which identifies the G/L accounts & goods movement types.
    balajia

  • What is the benefit of configuring the XSS Homepage Framework for ESS

    What is the benefit of configuring the XSS Homepage Framework for ESS?
    Over using standard iViews.

    It means you can disable (or enable) the exact functionality your customer needs rather than sticking with the default implementation.
    Most customes do not use everything available from ESS or MSS.  Switching it off (making it unavailable) is WAY better than leaving potentially unconfigured content to be accessed by users.  SAP generally do not handle the error cases and you will get lots of nasty stack traces .....
    Haydn

  • What are the steps to create classes?

    What are the steps to create classes?

    Hello.
    Here's one example applied to a BSP page.
    How to create your first OO Abap Class for a BSP
    Kind regards.
    Bruno

  • What is the benefit of using J2EE for webservices?

    (I posted this on google news group, but no one answer, sorry for the cross post)
    This maybe obvious to some of you, but after I went over the
    webservices tutorial from Sun, about XML RPC and JAXM, I don't know
    what is the benefit of using webservices within J2EE container.
    Please tell me about it.
    My assumption is that RPC and JAXM both enables the communication, but
    the managing of session, persistent, thread pool, connection pool,
    database, etc, are all handled by the container. Well, I still hope
    my assumption is true. However, from what I read, the tutorial does
    not even mention the word beans. So, how to get a beans to talk the
    JAXM language so that I can get all of the above features? Or am I totally off track here? if an enterprise bean is not needed, then how to get all the above benefits that the J2EE offers?
    By the way, does Sun's RPC and JAXM has things such as quality of
    service (such as request time out). They mention guarantee delivery,
    but if a reply to my query come 5 minutes later versus instantly, then
    I probably lost a customer already. RPC also has big limitation, Corba has asynchronous request, but Sun's RPC does not.
    Thank you in advance for all comments and help.

    Basic communication aside, J2EE is mostly a synchronous run-time environment. When asynchrony is introduced, a whole new set of infrastructure requirements is needed to support QoS and commercial-quality implementations. In other words, it's not just about API anymore, it's about reliable communication, exception handling, time outs, etc. You may want to look at this Q&A to see some of the benefits provided by J2EE as underlying run-time for orchestration:
    http://searchwebservices.techtarget.com/ateQuestionNResponse/0,289625,sid26_cid511195_tax292928,00.html
    Doron\
    Download Collaxa 2.0
    http://www.collaxa.com

  • What is the benefit of using POE than AC Power?

    Hi,
    We are currently research on what is the benefit of POE over AC Power for wireless AP.
    Most of AP we are using is 1252 and 1142.
    Anyone can tell the different?

    Hi,
    Try to plan to install both scenarios and you'll know the difference yourself.
    Besides what Leo mentioned, imagine that you are going to use AC power and for every AP you are going to install a power outlet close to the AP to power it up.
    Now, if later you decided to change the AP location you need to install a new power outlet in the new place. The old power outlet is usually left wihtout use. extra cabling, extra waste of resources (materials, man power...etc).
    HTH
    Amjad
    Rating useful replies is more useful than saying "Thank you"

Maybe you are looking for