Situation where you are interface & abstract class?

please let me know if any one knowns answer for the above question

But my doubt in which situation we r using interface
and abstarct classesWithout repeating the debates, you should use interfaces to define the contract for developers to use. This is usually done when nothing is known about the concrete implementation but the design is ready. This is also useful when you need to have multiple inheritance.
Abstract classes are useful when you want to force the implementation of some of the methods onto the developers, rather than everyone having their own implementations. This is preferred when there is some concrete idea of some of the methods in the class while the implementations of the remaining methods can vary with the specialization of the sub-classes.
You might want to read this:
http://www.javaworld.com/javaworld/javaqa/2001-04/03-qa-0420-abstract.html

Similar Messages

  • How can I make it to where you are not aloud to delete the history unless you have a password? Public Fox does not work because they can simply go to "Show All History" and delete from there.

    Alot of people use my computer and I would like to make it to where you are required to have a password to delete the history. I tried public fox but you can simply delete the history by accessing "Show all history". So public fox doesn't work.

    Sorry, Firefox doesn't have a password feature for browsing history, and I haven't seen an extension for that.

  • How to loop with varying values depending on where you are in the loop

    Hi,
    I have need of loops / nested loops that pick different figures depending on where you are in the loop.
    The whole function needs to run through 'ml' times. 'ml' is a dynamic figure.
    Loop 1 = While the loop is within the first 12 iterations, 'exconemp' must equal 100. For iterations 13 - 24, 'exconemp' must equal 102.5, for 25 - 36 it will be 105.06, for 37 - 48 it will be 107.69. This needs to change every 12th iteration until it has reached 'ml'. The calculation takes the value of the previous 'exconemp' and then multiplies that by 0.025.
    Loop 2 = While the loop is within the first 120 iterations, 'abc' must equal 0.015 and any further iterations must use 0.01. This must also work in a way to figure out whether 'ml' is higher or lower than 120 and work accordingly.
    My main issue is this - how do I get the loops to run through as this:
    While the iteration is < 12, do this, THEN take the final figure (12th iteration) and start on 13 - 24, do this THEN etc etc.
    How do I produce a THEN statement? I can get the code to pick up the final values, but not change along the way.
    I think that I may be better creating an array for Loop 1, but I am not entirely convinced of this. I also think it would be better/tidier if I can get 'month 1 total' and 'month 2 total' into the loops, but am not sure on how to do this.
    The values that I need to produce are (only first 36 shown):
    1 - 12 = 125.55, 251.65, 378.31, 505.52, 633.29, 761.63, 890.53, 1019.99, 1150.03, 1280.63, 1411.81, 1543.57
    13 - 24 = 1679.05, 1815.12, 1951.79, 2089.06, 2226.93, 2365.41, 2504.50, 2644.20, 2784.52, 2925.45, 3067.00, 3209.18
    25 - 36 = 3355.19, 3501.85, 3649.15, 3797.11, 3945.71, 4094.96, 4244.87, 4395.44, 4546.68, 4698.57, 4851.14, 5004.38
    var ml = 240 // dynamic figure, multiple of 12 up to 780
    var exconemp;
    var exconem = 100;
    var inf = 0.025;
    var tree;
    var tec;
    var power;
    var fvis;
    var abc;
    var fvee;
    var tfv;
    function myfunction() {
    //Loop 1
    //while (ml <= 12) {
      exconemp = exconem;
    //while (ml > 12) {
    // exconemp = exconem*inf;
    //end Loop 1
      trace("exconemp=", exconemp); // employees contribution
    tree = exconemp/(1-0.2)-exconemp;
    tec = exconemp + tree;
      trace("tree", tree);
      trace("tec", tec);
    power = Math.pow(1+0.07, 1/12);
    //Loop 2
    //while (ml <= 120) {
      abc = 0.015;
    //while {
      //abc = 0.01;
    //end Loop 2
    fvis = power*(1-abc/12);
    trace("fvis=", fvis);
    fvee = tec*fvis;
    trace("fvee=", fvee); // month 1 total
    tfv = (tec+fvee)*fvis;
    trace("tfv=", tfv); // month 2 total
    for (var i:Number = 0; i < ml; i++)
          tfv = (tec+tfv)*fvis;
      trace("tfvloop=", tfv);
    I hope that I have explained this well enough.
    Many thanks in advance.

    I think this will do it although I am not quite getting the numbers you posted.
    stop();
    var ml = 48; // dynamic figure, multiple of 12 up to 780
    var exconemp;
    var exconem = 100;
    var inf = 0.025;
    var tree;
    var tec;
    var power;
    var fvis;
    var abc = 0.15;
    var fvee;
    var tfv;
    myfunction();
    function myfunction()
        exconemp = exconem;
            for(var index:uint = 1; index <= ml; index++)
                trace(index + "--------------------------------");
                    tree = exconemp/(1-0.2)-exconemp;
                    tec = exconemp + tree;
                    power = Math.pow(1+0.07, 1/12);
                    fvis = power*(1-abc/12);
                    fvee = tec*fvis;
                        if(index == 1)
                            trace("month 1 total=", fvee);
                        else if(index == 2)
                            tfv = (tec+fvee)*fvis;
                            trace("month 2 total=", tfv); // month 2 total
                        else
                            tfv = (tec+tfv)*fvis; //now that we are here the tfv self perpetuates on itself
                            trace("month " + index + " total=", tfv); // month n total
                if(index % 12 == 0)
                    exconemp = exconemp*(1+inf);
                    trace("changed exconemp to: " + exconemp);
                if(index % 120 == 0)
                    abc = .01;
                    trace("changed abc to: " + abc);

  • [svn] 3519: Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service .

    Revision: 3519
    Author: [email protected]
    Date: 2008-10-08 04:17:40 -0700 (Wed, 08 Oct 2008)
    Log Message:
    Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service. The error string said that there was no flex.messaging.services.AdvancedMessagingService registered but it is the flex.messaging.services.AdvancedMessagingSupport service that needs to be registered.
    Add configuration test that starts the server with a destination that has the reliable property set which is an advanced messaging feature but there is no AdvancedMessagingSupport service registered.
    Modified Paths:
    blazeds/trunk/modules/common/src/flex/messaging/errors.properties
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/error.txt
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/services-config.xml

    Hi,
    Unfortunately I already tried all kinds of re-installs (the full list is in my original message). The only one remaining is the reinstall of Windows 8 itself, which I would really like to avoid.
    What I find really strange is the time it takes for the above error message to appear. It's like one hour or even more (never measured exactly, I left the computer running).
    What kind of a timeout is that? I would expect that, if ports are really used by some other application, I get the message in less than a minute (seconds, actually). To me this looks like the emulator itself for some reason believes there's a problem with
    some port while in reality there isn't.
    I'll eventually contact Microsoft Support, thanks for the suggestion.

  • Is it possible for your Mobile Me Account to say you are somewhere where you are not?  Can you tell it to make you appear somewhere else?

    Can you make your Moblie Me Account say you are somewhere where you are not?  Can you tell it where you want it to say you are?
    Thanks

    Sounds like one great relationship.
    With an iPhone that has not been hacked, no.
    Don't know about anything about a hacked iPhone or an illegal app involving this which is against the terms of use for these discussions.

  • How do you know where you are in the Lion queue??

    Can someone tell me how you know where you are in the queue for the Lion download? I am just left with the waiting signal over the lions head?

    Look here ...
    iCloud: iCloud storage and backup overview
    https://www.apple.com/support/icloud/backup/

  • HT201317 I am trying to turn Photo Stream on - on my Mac when I get to the space where you are supposed to click the icon and go to Photo Stream - Photo Stream is not highlighted and nothing happens when I click on it -- what do I do?

    I am trying to turn Photo Stream on - on my Mac when I get to the space where you are supposed to click on the Photo Stream icon -- the icon is not highlighted and when I click on it nothing happens --- what should I do?

    the space that I am referring is the "screen" that pops up after I go to Apple icon - select System Preferences - the iCloud screen pops up and you are supposed to be able to click on the Photo Stream icon to turn Photo Stream on.  Well, the icon "Photo Stream" is not highlighted and has no check box so that I can select it to get to the screen that will let me turn Photo Stream on. 

  • 1488: The workstation is no longer imported to the tree from where you are attempting to launch the operation. The Remote Management session cannot proceed.

    After upgrading a Windows XP Pro SP1 machine to the ZfDagent from the
    zfd65u2 patch I receive the following error:
    1488: The workstation is no longer imported to the tree from where you are
    attempting to launch the operation. The Remote Management session cannot
    proceed.
    For now I have went back to the ZfD 4 IR5 agent which doesn't exhibit this
    problem. Any ideas?
    Jim Webb

    Jim,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • We were unable to find any Azure subscriptions where you are a service administrator or co-administrator.

    Hi All,
    My service administrator had made me a co- admin in our corporate Azure account.My email account is in office 365 , but my user profile is still in onprem server . i am trying to login via https://manage.windowsazure.com . and it throws me the below
    error
    We were unable to find any Azure subscriptions where you are a service administrator or co-administrator.
    You are signed as
    [email protected] in the directory keoic.onmicrosoft.com ('my company name'). If this was not the account you intended to use, please sign out and sign in again using the intended account.
    please advice.
    Regards
    Roma

    Hi,
    We are not able to view any information for the specified live id. I recommend you to ask your service administrator to double check if he has added your email address as co-administrator , also raise a
    service request with subscription management team if the issue still persists.
    Regards,
    Shirisha Paderu

  • Is that where you are offering to help retrieve the encryption-answer questions and cod have been an accident and do not forget the answers

    HHlo Is that where you are offering to help retrieve the encryption-answer questions and cod have been an accident and do not forget the answers

    How to reset your Apple ID security questions
    Go to appleid.apple.com and click on the blue button that says 'Manage Your Apple ID'.
    Log in with your Apple ID and password. If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email.
    Go to the Password & Security section on the left side. Then underneath the security questions click on the link that says 'Forgot your answers? Send reset security info email to [email]'.  This will generate an automated e-mail that will allow you to reset your security questions. 
    If that doesn't work, or  there is no rescue email link available, then you will need assistance from Apple Account Security. Follow this procedure:
    click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later. 
    Next, go to getsupport.apple.com. If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services'.
    Choose 'More Products & Services', then 'Apple ID'.
    A new page will open.  Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
    Click the blue 'Continue' button.
    Select the contact option that suits your needs best.
    The above information quoted with gratitude from TJBUSMC1973, another user in these forums.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base before you post a question.
    Regards.

  • Interfaces, Abstract Classes & Polymorphism

    I have a friend taking a Java course as part of a larger degree program, and she's asked for some help with an assignment. The assignment is as follows:
    This assignment is to write a simple encryption/decryption application.  There will be a single application
    that the user can use to encrypt or decrypt a phrase passed in on the command line, with the user deciding
    which encryption/decryption scheme to use.
    The first scheme is to add 1 to each character that is in the phrase, the other is to subtract 1 from each
    character that is in the phrase.
    To encrypt, you must be able to use the follwing syntax:
    java Crypto encrypt Additive "hello"
    Output:
    "hello" encrypts to: "ifmmmp"
    To decrypt:
    java ca.bcit.cst.comp2256.a###### decrypt Additive "ifmmp"
    Output:
    "ifmmp" decrypts to: "hello"
    Use Additive or Subtractive as the arguments to choose which encryption/decryption to
    use. The problem is, I'm not entirely sure how to use abstract classes and interfaces to do what is being asked. I'm pretty sure I could do the whole program in a single for-loop, but apparently her teacher doesn't want people coming up with their own solutions for the problem. I don't need any code for how to do it, per se, I'm just wondering how one would structure a program like that to include interfaces, polymorphism and abstract classes.
    Anyone have any ideas?

    with the user deciding which encryption/decryption scheme to use.This is the key sentence. encryption/decryption can be done using multiple schemes. The contract for any given scheme can be defined using
    public String encrypt(String input);
    public String decrypt(String input);There can be multiple implementations for these methods, one set for each scheme.
    The contract therefore becomes the interface and each implementation is a concrete implementation of this interface.
    The problem doesn't delve deep into the kind of schemes available. If it does and there is a significant overlap between 2 schemes, an abstract class that takes care of the shared logic among 2 schemes comes into picture.
    Hope this helps!

  • Situation where there are a lot of AgentErrorCount in Call Type Reporting

    Hi Team,
    I am facing a situation where there is a lot of AgentErrorCount, and my customer are now getting worried of loosing calls.
    I looked at the latest "Reporting Guide for Cisco Unified ICM - Contact Center Enterprise & Hosted, 8.0(1), Nov 2010 " and the given definiton about AgentErrorCount is this one:
    • Calls that abandon en-route to agents are calls that encounter an error when the call is at the agent desktop. This call is counted as part of the AgentErrorCount in the Call_Type tables.
    I tried to make several calls in my lab (e.g. hanging the call while the phone is ringing or even before the phone is ringing to duplicate this issue without success ...
    Does anybody knows what that mean exactly when calls are "abandonned en-route to agents" ? Is it network related ?
    Any feedback is appreciated on this !
    Thanks & Regards
    Nick
    Thanks & Best Regards

    Hi Nick,
    Abandoned en-route to agent actually means when ICM reserves an agent and sends the information to Call Manager to make the phone ring. when the phone is about to ring, if the agent un hooks the receiver or if he goes to the aux mode the call will fail. This call is listed under the abandoned calls en-route to an agent. However the number of failed count due to this is very less. If you see more number of calls in calls error, you would also need to verify other scenarios on the network too. As you have not mentioned whether the Contact center and the Data center components are in the same or  different location at this point of time I cannot conclude on the answer. If they are seperated over WAN you would need to check on the network side also.
    Thanks,
    Dass

  • Interfaces / Abstract classes / ResultSets

    I want to set the fetch size of each java.sql.ResultSet throughout my application, in one place. ResultSet is an interface and a ResultSet is returned by a call to PreparedStatement.execute(). So I figured I could implement ResultSet in an abstract class of my own and just override getFetchSize() or put a setFetchSize() in the constructor. Anyway, it seems I get a ClassCastException when casting the ResultSet returned from PreparedStatement.execute() to MyResultSet:
    java.lang.ClassCastException: oracle.jdbc.driver.OracleResultSetImpl
    I've tried having MyResultSet implement oracle.jdbc.driver.OracleResultSet too just in case. But no luck there either. If I try and implement OracleResultSetImpl I'm told it's not public and so can't be accessed from outside the package.
    Can I do this somehow? Or an alternative, simple way?

    I want to set the fetch size of each
    java.sql.ResultSet throughout my application, in one
    place. ResultSet is an interface and a ResultSet is
    returned by a call to PreparedStatement.execute(). So
    I figured I could implement ResultSet in an abstract
    class of my own and just override getFetchSize() or
    put a setFetchSize() in the constructor.Yes, you can.
    Anyway, it
    seems I get a ClassCastException when casting the
    ResultSet returned from PreparedStatement.execute()
    to MyResultSet:Well, you have to re-implement PreparedStatement as well, otherwise of course it won't even know that your class exists, let alone use it.
    Serializabe z = method();
    If I define method() to return a String, it doesn't mean that it'll suddenly return something else simply because I wrote it and it also implements Serializable.
    java.lang.ClassCastException:
    oracle.jdbc.driver.OracleResultSetImplThe object you get is simply not an instance of your class.
    Simple way around: create a wrapper class around the original ResultSet that does what your implementation did.

  • After downloading and updating my iPhone my apps are now backed up on my laptop and I can't move them back over to the phone. I tried to follow the instructions in Help section, but the screen where you are supposed to select the apps to share won't let m

    The screen where you should select the apps you want to share is greyed out. It won't et me drag them either. Any thoughts?
    Thanks!

    Hi skippy2012trev,
    Welcome to the Apple Support Communities!
    I understand that you updated your Apple Id and password but now you are being prompted for the old information in iCloud. You are on the right track by changing the Apple ID back to the previous email address temporarily so that you can sign out. You should not need to verify the email address. After you edit the Apple ID back to the old email address and then sign out of iCloud on your iPhone, edit the Apple ID back to the address you would currently like to use. There is no need to change the password again, only the email address, unless you prefer to update the password again.
    If you're asked for the password to your previous Apple ID when signing out of iCloud - Apple Support
    Change your Apple ID temporarily
    If signing out and back in to iMessage or FaceTime didn't help, try these steps:
    Change your Apple ID to the Apple ID you used previously. You shouldn't need to verify the email address.
    Tap Settings > iCloud. Complete these steps only if the Find My [Device] setting is turned on:
    Scroll down and tap Sign Out, then tap Sign Out to confirm. If you're using iOS 7 or earlier, tap Delete Account, then tap Delete to confirm.
    Tap Keep on My [Device] or Delete from My [Device]. In either case, your data remains in iCloud and will be updated on your device when you sign in to iCloud again.
    Enter the password for your previous Apple ID.
    Change your Apple ID to the new email address that you want to use. You'll need to verify the email address.
    Return to Settings > iCloud and sign in with your new Apple ID.
    Cheers,
    Joe

  • Ordered & unordered arraylist with interface & abstract class

    you can remove this
    Edited by: Taco_John on Mar 9, 2008 7:38 PM

    http://www.google.com/search?q=java+interface+%22abstract+class%22
    http://www.google.com/search?q=java+method+overloading+overriding

Maybe you are looking for