Why to use inheritance when import is sufficient

The import directive tells the compiler where to look for the class definitions when it comes upon a class that it cannot find in the default java.lang package. After an import statement has been included in our program we can use the methods related to that class as required and we are not required to give the fully qualified names.
In inheritance we extend a base class into a derived class so that the features and methods of the base class are available in the derived class which facilitates reusability. As per my understanding the same thing is facilitated by import statements. If it is so, why are we using inheritance if it can be done with the use of import statements?

Import statements and inheritance are completely different things.
Import statements tell the compiler how to expand brief class names into fully-qualified class names. It has nothing to do with the functionality of the code.
Inheritance changes the identification and functionality of the classes, and thus the functionality of the code.
Maybe you're really thinking about composition/delegation vs. inheritance. Composition is when a class has another class as a part of it, and delegation is when the class sends some of its work to the other class. You can have an object-oriented system without inheritance of implementations, using composition instead.

Similar Messages

  • Why to use B2B when we can go with ...

    why to use B2B when we can go with A2A with FTP services running in the source and target systems.
    why do we go for parties if the above one is possible.
    plz help out im into loads of confusion

    Hi
    A2A is application to application: when two applications in a company talk to each other we call it an A2A scenario and if its across Companies we call it B2B or buisness to buisness scenarios.
    All the following links will explain   the difference between A2A and B2B
    With scenario’s
    A2A   B2B Scenarios
    can anyone explain A2A & B2B  AND  BPM & ccBPM  with an example..
    Help for Scenario! B2B or A2A
    A2A Vs B2B
    A2A and B2B
    I hope this will answer your question
    regards
    --- prasad

  • Why are missing items when import pst files to Outlook 2011 for mac?

    Hello.
    After installing Office 2011 for Mac I configured Outlook and it was allright.
    But when I tried to import a pst file from the old laptop who has Office 2007, I found that in the Outlook 2011 Inbox I have only ~60% items comparative with the Outlook 2007 Inbox.
    From Microsoft Office forums I've got an answer that there are indeed some reports with missing items when import pst in Outlook 2011 but the solution they gave me (create folders in Inbox before import) doesn't work.
    Do you know something about this kind of problems?
    Is it a feature in Outlook 2011 which automaticaly select/delete/combine items based on the similarity between them or based something else?
    Have you an ideea how to finally use this macbook and in the same time all my old emails?
    Thanks.

    Hi Steve,
    Thanks for this-yes, eventually, I do send/receive fine, once I've poppedd my passwords in. 
    I think you are right in that BT seem to be having unique server/login issues...at least this is what I've read elsewhere too.
    Iroonically, this AM I opened my new Mac and have *not* been asked for passwords so perhaps the changes I made in the settings yesterday (keychain reset in Mac) and also changing it from smtp.....to mail.btinternet.com solved the issue...who knows? All I know is this last week I've nearly lost the will to live on more than one occasion, from the transition from PC Windows Live Mail to Outlook for Mac.

  • Is it advisable to use inheritance when reusing dialogs/frames?

    Hi!
    While working on a project, I've noticed that there are instances when I could reuse code by creating general forms (as dialogs or windows) and subclassing them. For example, I have this set of dialogs which have a similar function: each dialog has a table (or list) of objects and functions for adding, deleting and editing objects in this table. Do you think that it's good to use inheritance in this case? That is, I create a general AddEditDeleteDialog from which to subclass particular dialogs, AddEditDeleteObject1Dialog, AddEditDeleteObject2Dialog, ...
    Thanks!

    Yes, of course. But to what extent? Should I include
    layouting code, component initialization, event
    handling, etc in the superclass (AddEditDeleteDialog),
    or should I let the subclasses (AddEditDeleteObject1Dialog)
    handle that?Basically, whatever is the same in all the subclasses can be placed in the superclass. If there are differences, then you should place it in the subclasses.
    Things like event handling can be placed in the superclass, where each method in the event listener fires an abstract method in the superclass, which each of your subclasses implement to provide custom event handling.
    Component initialization can also be used in the superclass for whatever components are used in all of the subclasses. Subclasses can then add any components which are unique to them.
    You should also be aware that the purpose of inheritance is to add to the functionality of a class. If your subclass provides no extra abstract functionality then you should just use one class, and change some settings each time you need to use it for a different purpose. E.g. If your dialogs contain the same components, same actions etc but different text, then use just one class, and for each dialog, set the text for each of the components accordingly.
    There is no hard/fast rule for using inheritance and how to design an object hierarchy, and as my first programming teacher used to say "every programming problem can usually be solved in loads of different ways."

  • Why does LR crash when Import command is used? The only solution I can see is to restart my PC. Issue pre-dates latest LR upgrade.

    LR has stopped working several times when I use the Import command (button and from File menu) - Windows gives the options of waiting or closing LR. I have waited for 30 mnutes but nothing happens. This pre and post-dates the latest LR upgrade. I'm using Windows8 and have only had problems in recent days. The only solution I can see is to restart my PC. What's happening - any ideas?

    Dorin:
    I have uploaded the catalog file and the photo included in that catalog (a Canon 20D .CR2 file) to RapidShare at:
    http://rapidshare.com/files/139240757/_MG_7731.CR2.html
    http://rapidshare.com/files/139240759/LR_Test_Catalog.lrcat.html
    I am assuming that the associated "LR_Test_Catalog Previews.lrdata" folder isn't required too and will be recreated for you?
    John:
    Yes, I imported some .CR2 files taken from home to the office and imported them into an existing catalog there. And yes, they're shown okay. Plus other 2006 files (from the same camera, I usually import into both) are okay too. There are some .XMP files in some 2006 folders, but not many. I will take the catalogue (sorry, got caught up in the Yank spelling) from home to the office on Monday and try importing that, hadn't thought of that. The photo's won't be in the same folder structure though and not all will be there.
    Apologies for not answering the other question, I am a person who came from the Pixmantec RawShooter background and would have still been using that program then. The .RWSettings folders are still in the folder structure. I am pretty careful with my .CR2 files and try not to use any programs that would directly edit them. I have backups on DVD, but I haven't tried them. I also have another copy of some 2006 files on another HDD and have tried importing them tonight into the new catalog with no change in behaviour.
    I will also try setting the camera date to 2006, take some new pics and see what happens.
    Apologies, too, about the apostrophes, my dear Mum would be most embarressed at me. Can't edit them now, history has passed by!
    Thanks for your assistance.
    Simon...

  • Why does Aperture crash when importing modified image into Photoshop CS2?

    I have been using Aperture 2.1.4 for the past 2 years and really like the interface. But, I've had one nagging problem: I begin by scanning all of my slides with the Nikon Coolscan 4000 and save them as large tiff files @ approx. 55mb each. I then import each slide with a custom color profile into Aperture. I then optimize the image including white balance, levels, and color adjustments. When I want to make additional changes that I'm not able to do in Aperture, I attempt to send the image to Photoshop CS2 for further processing. But, at this point, Aperture crashes. After this, I get a message saying "do you want to re-open Aperture or quit?" Additionally, I often get the message "Aperture has applied new settings. Do want to keep these new settings or use the original settings?" Since I don't know what will happen if I choose "use the new settings," I always select "keep the original settings." And, when I open Aperture again and try, again, to send the image to Photoshop CS2 to edit, Aperture crashes again. Has anyone had the same or similar problem who can give me some ideas of how to solve this issue! Thanks.

    Welcome to the forums!
    It sounds like there may be a permissions issue between the two apps, Aperture using one and PS another.
    1. Are you logged in as an administrator?
    You need to be.
    2. Where is your library stored, is it in the picture folder of your user directory?
    If so moving it in to the general area of your MacHD may help get over some of these issues.
    3. Have you run any of the Ap First Aid steps? Have a read of this page;
    Ap2
    http://support.apple.com/kb/HT2945
    Ap3
    http://support.apple.com/kb/HT3805
    4. Is it possible that the upgrade to Ap3 would get you around the need to jump into PS?
    Start with these ones and then come back letting us know how you go.
    Tony
    Message was edited by: Tony Gay Added Ap2 First Aid link.

  • Why still use DV when we have HD formats nowadays?

    Hi guys,
    Coming new to the video scene, I have a question about why we still need to bother with DV when the world is going HD these days?
    Is it because of the "install base" of a lot of NTSC/PAL equipment (including cameras, edit stations and televisions) that still need the DV format in the broadcast studio workflow?
    I am asking because increasingly it seems the acquisition equipment is HD (both consumer and pro) and playback is HD with more HDTVs in people's homes. And Blu-Ray coming out as a delivery format.
    And for everything else, including iPods, computers, Web, etc. it's just a matter of converting HD into another size for end user delivery.

    I agree with cgbier's comments and would like to add my two cents. I work in television somewhere around market 50. An indie filmmaker or one-man production house might be able to upgrade to HD for under, say, 9 or 10K - probably less. A good-size news television station has upwards of 20-25 production cameras, at least twice as many media decks, and probably more than a few out-of-date NLE's that would have to be completely replaced. And all of those things are secondary to the more pressing issues of replacing your transmitter, routers, studio cameras, etc to meet the FCC's digital deadline next year. The costs become staggering when a corporate owner has to consider these purchases for the 15+ stations they may own. I see a lot of smaller stations simply upconverting their existing SD output for a while.
    On the personal side, I just purchased an HDV camera and a new iMac; upgrading my gear for my freelance work. I was using Final Cut Pro 4.5 but was forced to buy FCExpress when I found out that the hardware of the new iMacs wouldn't support FCP 4.5. So there goes the $1200 I spent on FCP and after buying the camera ad computer I couldn't afford FCP Studio. Then I discover that FCExpress doesn't support deck control for HDV cameras. I hope someone can appreciate my frustrations.
    I have a few other friends that have had similar frustrations trying to adopt HDV or worse, AVCHD, and become cynical about jumping on the HD bandwagon, pouring more money into it than they had hoped to.
    Message was edited by: Kevin Olmsted

  • Is there an easy way to use MOVE when importing from card reader?

    In Lightroom 1, I would hit File -> Import From Disk which would allow me to move photos from my card reader to the hard drive.
    In Lightroom 3, the only option is the normal import dialog and in order to get the "Move" option I have to select "other source" and then scroll down the list to select the card reader in order to get the "Move" option.  It's a pain to do it every time.  (not to mention my wife will never do it and just use "copy").
    So my question is, "Is there a way to get the Move option to be available by default on my card reader?"
    It's been my workflow since 2004 to have the images deleted directly after I copy them off the memory card using Adobe software (Photoshop Album 2.0, Photoshop Elements 4, Lightroom 1.0).  I'm really hoping there is an easy way to accomplish this in Lightroom 3. Otherwise I will be pretty disappointed.

    function(){return A.apply(null,[this].concat($A(arguments)))}
    brianbjork wrote:
    The reason I like the move command so much is that I know when photos are on my memory cards that the are not on my computer.
    LR defaults to not importing suspected duplicates.  so if there are still files on the card, they will be grayed out. That's how you can know.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    brianbjork wrote:
    What do you all use in your work flow to delete the pictures left on your memory cards after they are copied?
    I have a shell file that removes the files from the card and ejects the disk.  I keep it in my dock for easy access.
    Others will tell yiou, though, to format in camera. Which is a good idea! I just like to keep my cards empty and ready.

  • Why do photos flicker when imported and played in FCP?

    When I import certain photos (some, but not all), they flicker in FCP in various parts of the image, and they also have a funny flickering when played back on QT. I have scanned without any particular precaution. I was wondering if anyone could help me correct the issue.

    The flickering you see is an artifact of the interlaced nature of video. It is a result of either very thin (often horizontal) elements that exist on one scanline as is common in text/ titling or scanned images with a great deal of detail in high contrast. (Note: It does no good to import images hugely larger than the necessary pixel dimensions of the video sequence. All it does is force FCP to work harder at interpolation.)
    As the alternate fields play, the offending element is essentially being turned on/off creating the impression of a flicker. The basic strategy is to get the element to exist over two scanlines so it is refreshed every time the field plays and/or to reduce the amount of contrast so the difference between ON and OFF is not noticeable.
    Things to try (In increasing order of image degradation)
    - (in FCP) field order>none
    - (in FCP or Photoshop) reduce whites by 10% - reduces overly bright areas
    - (in FCP) flicker filter - minimum
    - (in Photoshop) motion blur>vertical> .2 - .5 pixels - blurs vertically only
    - (In FCP or Photoshop) Gaussian blur> .2 - .5 pixels -blurs both horizontally as well as vertically
    - (in FCP or Photoshop) deinterlace - throws away half the image and is generally not appropriate on scanned or still images.
    A neat Photoshop trick is to use the selection tool to limit area you apply the vertical and/or gaussian blur to only the troublesome part. This way you don't have to indiscriminately soften the entire image.
    Remember: Unless you are viewing your work in the appropriate external NTSC/PAL monitor, you are playing blind. The computer monitor only shows you a proxy image.
    good luck.
    x

  • Keep getting "required file in use" error when importing from a disc

    Installed 12.0.1 this weekend and now cannot import songs from a disc (have tried on several different discs). I keep getting the error message that "Error occurred while converting the file. The required file is in use). Have rebooted several times with no improvement.  There doesn't seem to be any problem playing anything off my existing library, but I also get failure messages when purchasing from Amazon. Anyone have ideas?

    Any Suggestions?
    Dmitry

  • Why do some tracks, when imported from Audacity, when selected, immediately flip to a different track?

    Up until early 2012, I digitized thousands of LP tracks using Audacity, exporting them as MP3 files and then adding them to my iTunes library as AAC format.  This all worked great.
    Now, after a year using a new MacBook Pro, I have started digitizing my remaining dozen LP's after downloading and installing the latest version of Audacity (2.0.3).  I noticed that several - not all - of the newly digitized tracks, when selected in iTunes, would immediately jump to a different track.  Sometimes the jump would be to a much older track, and sometimes to a track that was purchased from the iTunes store.  Sometimes the jump would be to the next track in sequence.  A Genius Bar staff suggested that I change from MP3 to AIFF, and that seemed to help after I re-digitized the problem tracks.  Today, however, I noticed that 3 of the 11 tracks from an album I converted yesterday were jumping to other tracks.  I had the AIFF preference set to 32-bit.  Would changing it to 16-bit help?  Why would only some tracks be affected?
    Argh!

    SJN Mpls wrote:
    This seems to have done the trick.  Thank you.
    You are welcome.  That issue between iTunes and Audacity comes up here every once in a while:
    https://discussions.apple.com/message/6959446#6959446
    If you are making archival copies of those LPs, keep the 32 bit copies somewhere and make 16-bit versions to use in iTunes.  Otherwise, just do everything in 16.

  • ITunes 7.02 fails to use VBR when importing CD to MP3 (used to work)

    Just checking the size of some files imported into iTunes from CDs in MP3 format . . .
    Although the settings haven't changed, it seems that somewhere between version 7.0 and 7.02, the VBR setting has become disabled. The settings are - custom:
    160kbps (mono)/320 kbps (stereo), VBR (Highest quality), 48,000 kHz, stereo, normal stereo, optimized for MMX/SSE, using MP.
    'Old' imports show up as e.g. '120kbps (VBR)' with file sizes being ~3.5 MB. 'New' imports all show as '320kbps' with file sizes of ~10 MB.
    does anybody know how to report this to Apple as a bug?
    Even better, does anybody know a fix?
    Cheers,
    Owen

    OK, I found an answer - install iTunes-LAME and set the properties I want.
    Here's where to get iTunes-LAME - but there is a 2.08 version that hasn't been posted there yet (Version Tracker has it though).
    iTunes-LAME
    http://blacktree.com/apps/iTunes-LAME/
    Version Tracker
    http://www.versiontracker.com/macosx/
    I'm using the manually entered settings to import CDs to MP3 of:
    -v -V 0 -B 320 -h -m s
    N.B.: these settings are 4 times slower than iTunes 320 kb import and result in file sizess somewhere between the old "iTunes with VBR" and the current "VBR is broken" iTunes ones.

  • Why is "-2" appended to imported filenames?

    When I import picture files to LR 5.2 in OS X 10.8.5, almost always, "-2" is appended to file names.
    Sometimes I find files in my LR catalog twice, once with the original name, and once with "-2" appended.
    I've tried tracing it different importing workflows, but so far I haven't been able to isolate the perpetrator.
    Here are some of my importing workflows:
    * USB cable from camera to Mac
    * USB cable from card reader to Mac
    With the source device connected to Mac, sometimes I open it in one of these:
       - Image Capture
        - LR 5.2
       - iPhoto
    Sometimes Image Capture, LR, or iPhoto is set to automatically recognize the attached picture source device, sometimes they are set to require manual opening.
    Sometimes I create a desktop folder with the name it would have when LR imports it, sometimes the folder is a generic name.
    Sometimes I move the folder with the destination LR to the final location in the directory tree, using OS X, before importing the files to the folder.
    Sometimes I import files into the folder using one of the above applications, then move the folder to its final location.
    Sometimes I transfer files into the folder using the OS X Finder, then move the folder to its final location.
    Sometimes I import  files into the folder that's already been put in its final location.
    Sometimes two, or all three, of LR and iPhoto and Finde,r are all looking at the source files at the same time, when the computer is connected to the camera or to the card reader.
    I haven't tested all of these methods yet, so it's not clear which of these methods might be the cause of the "-2."
    In LR, I have imports set to ignore files already imported, and to create a backup copy in a specific folder that's different from the one where the LR catalog is located.
    Do any users on the forum have this same issue? Which one or more of the impot methods is the cause?
    TIA

    CStaack wrote:
    LR puts a -2 behind a filename if this name already exists in the folder.
    Maybe you use renaming when importing and managed to customize this in a way that always leads to the same filename.
    Thanks for your reply.
    I'll take another look. I'll try a test and not import files into the catalog from within folders located in the OS X directory tree, where I want them to be in the catalog's directory tree. I guess this could be called "import in place."
    One reason I am trying to develop a workflow that's not LR's automatic import workflow, is that LR duplicates folders as subfolders within the directory tree, when it makes the folders for the import. I've been trying to avoid this. My camera is set to make a new folder for each day. Would this confuse LR?
    I don't rename files when importing.
    I'll report back when I have some results.    

  • Does anyone else this error after iPhoto crashes when importing?

    I tried searching for answers on Google, Bing, Webcrawler, and even Wolfram but there is no answer for this anywhere on the web.  Just got done installing my new hard drive.  I made sure to backup EVERYTHING and I even made a zip copy of my iphoto library.
    On my initial first launch of iPhoto, I try to import my library and iPhoto crashes after about 3 seconds.  In the error report window that comes up, it lists this as the reason why it was terminated:
    '[<NSCFDictionary 0x1f0ad190> valueForUndefinedKey:]: this class is not key value coding-compliant for the key 1140.'
    Does anyone know if this is a simple code fix or how to solve errors like these?  Remember, this is fresh install of OS X on a new SSD hard drive.  All of my Adobe apps are running great with no hassles.  The only apps that are giving me trouble are iPhoto and Aperture.
    Even worse is that now Aperture is stalling every time I try to export a version of a photo that I retouched.  I'm thinking it probably has something to do with why iPhoto constantly crashed when importing.
    Any ideas or suggestions would be greatly appreciated. Thank you!

    When I said, "import," I meant that I do drag my iphoto library as whole and drop it into iPhoto.
    That is eactly what you NEVER do - that is importing the old library into the new one - you never do that
    again it is very simple
    You NEVER Import an iPhoto library - period
    You drag an iPhoto Library  intact as a single entity to the pictures folder and launch iPhoto --  No importing involved
    LN

  • Error message when importing data using Import and export wizard

    Getting below error message when importing data using IMPORT and EXPORT WIZARD
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    <dir>
    <dir>
    Messages
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'.
    Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".
    (SQL Server Import and Export Wizard)
    Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Destination - Buyer_.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination
    - Buyer_First_Qtr.Inputs[Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Buyer" (28) failed with error code 0xC0209029 while processing input "Destination Input" (41). The
    identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information
    about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
    (SQL Server Import and Export Wizard)
    </dir>
    </dir>
    Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - Buyer_First_Qtr returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Smash126

    Hi Smash126,
    Based on the error message” Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting
    autogrowth on for existing files in the filegroup”, we can know that the issue is caused by the there is no sufficient disk space in filegroup 'PRIMARY' for the ‘REPORTING’ database.
    To fix this issue, we can add additional files to the filegroup by add a new file to the PRIMARY filegroup on Files page, or setting Autogrowth on for existing files in the filegroup to increase the necessary space.
    The following document about Add Data or Log Files to a Database is for your reference:
    http://msdn.microsoft.com/en-us/library/ms189253.aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Sybase Mobile Sales for Window Mobile

    Mateus, antes de ir pra perguntas, só pra alinhar. A SAP está com 2 diferentes estrategias para Mobile: 1) para microapps, backends apenas baseado em stack ABAP e empresas com plataforma móvel única, a recomendacao é o Gateway como plataforma de inte

  • USB Drive not available after 10.5.2 - URGENT (cannot access work files)

    Just got the Software update for 10.5.2, everything seems to work fine, except that my system no longer recognizes my USB Western Digital My Book 500GB drive. The drive does not mount automatically as it did before. When I go into Disk Utility, I can

  • How do I create this pattern brush?

    I am trying to create the "squiggly" line border/frame on the outside and I'm sure it's easy to do, but I just can't figure it out. Can anyone help me?

  • Increase Speed

    I have exactly 1212 photos in my library mostly 5.1 megapixels. I noticed that the speed at which photos show up in full screen mode is really slow. Is there a way I can rebuild the cache and possibly speed things up?

  • NOT DISPLAYING IN LKM DROP DOWN BOX

    I want to load XML file form Flat file. I want to use LKM as LKM FILE TO SQL It is available in my project. I don't see LKM FILE TO SQL  in LKM selector drop down in flow tab of interface