Why to take refrence of ArrayList in it's interface List

hi all
as i am new to java n found a strange thing in various books that
when they make object of ArrayList thye took it's refrence in List i.e its interface type ,i know by doing so we costrained the limit of arraylist object as it only use methods defined in list ,so my question is why to assign ArrayList object's refrence to List type,as we cannot take full advantage of Arraylist's class methods
Thanks

Suppose you only need a "thing" with the functionality of a List. You
couldn't care less then if I gave you an ArrayList, LinkedList or whatever
list; as long as it implements the List interface.
kind regards,
Jos

Similar Messages

  • **Tech explanation why BACKUPS take long, how to make it very short, etc*

    I noticed my backups to increase quite a bit over the last few days. I also noticed so many posts on why are backups taking so long, what can I do (only solution given is to click x or modify so that backups are not done, etc). Well to answer all those that want the "real" answer, I decided to do a few minutes of research and share what I've learned. I have seen nothing at all on google or anywhere else about the recommendations I'm suggesting, but from my experience I think it will answer 99% of all the backup threads on this site.
    All your backups are being stored in:
    XP: C:\Documents and Settings\(Your Name)\Application Data\Apple Computer\MobileSync\Backup\
    Vista: C:\Users\*Your User*\Appdata\Local\Apple Computer\
    Mac: ~/Library/Application Support/MobileSync/Backup
    The main directories are GUIDs that are based on the version of the iphone, so you may see more than one folder. Make sure to view the date last modified of the folder to make sure you go into the latest one. Order the files inside this directory by date modified. Here you can see how many files are being updated ON EVERY BACKUP. The older ones are not being backed up anymore because you probably uninstalled that app on the iphone (apple doesn't delete old unnecessary backup files that won't be ever used - bad programming #1). They are encoding all these files and inside the files in base 64, so you can decrypt them to view the contents, but you don't really need to and I don't have to show how for the solution to this. Open a file in wordpad. Within the first few lines you'll get an idea of what the backup is.
    So here is the solution....sort these files by date modified. My biggest single file was 29,582KB!! looked inside and it's the WeDict app. There are other files from WeDict, but obviously for me if I want fast backups I need to get rid of this app. A few other top files I found are awesome apps on the iphone that have awesome trailers, intro movies for games, etc. Well guess what, they backup every single game intro, trailer, etc. So for instance, the game tap tap tap has a few m4a songs....well every one of those m4a songs are encrypted and backed up EVERY TIME (apple backups up files that don't need to be backed up which would probably reduce backup times by at least 98% - for instance, intro movies don't need to be backed up, nor app songs, nor game instructions, etc because that information should be on itunes backed up separately when you install an app, not when you do backups and it should be smart enough to update that folder when a new version is out....and only do backups on files that can change like high scores in apps, notes, etc - bad programming #2).
    So anyway, you can see which apps are taking the most amount of time. Obviously if you remove every app on your iphone, it will backup fast, but some of these apps are shockingly huge. Problem here is that you can have 1 file or 100 files associated with 1 app. You could have only 2 apps installed on your iphone and your backups could be slower than a person having 30 apps just because some apps take a ridiculous amount of more backup data and time and what makes this even worse is every part of the data is encrypted, which I will talk about below (which doesn't need to be). Only time that file is not going to get updated is if it's deleted from your iphone.
    You don't HAVE to use base 64 encryption. Come on now, especially on apps? They could lighten the encryption and it would be much faster backups because it has to decode and encode every file now. You are overencrypting these files so huge programs take forever backups. (Bad apple programming #3 don't over encrypt when speed is a necessity on something that doesn't need extreme high security).
    As a developer with a computer engineering degree, to also make it even faster than what users were experiencing with backup times prior 2.0. They are obviously not tagging each portion that needs to be backed up individually. Lots of software companies do this to speed stuff up. For instance if you have Kaspersky antivirus with the defaults, the first scan will always take long, but every scan afterwords will be fast because instead of rescanning that file for a virus, it just checks to see if the checksum has changed and if so rescan that file, so most of the time the scan will happen fast unless there has been a period of time that you haven't done one that updates the checksums. They could do something very similar with this. So basically even if you changed a few things on your phone, the backup should be only a few seconds because only those few changes would be signaled to be rebacked up. (bad apple programming for backups #4). This process can make backups be from 98% faster to 99.98% faster....meaning having a backup only take 4 seconds even with 100 apps installed. Actually coding this one thing would make it extremely fast, but would take the most programming time. You can even make an algorithem where for the whole backup process it would just have to read one file that it would check checksums and then tell it to modify 1 or 2 other files and that's it as opposed to backing up (for me almost 5,000 files) some being several MB in size.
    So all the above should give apple suggestions on how the can speedup backups by 99.98% faster than how they are doing it now and then anwers all those questions why it takes longer, what needs to change, how can I shorten my backups (this way you can find out what apps are taking the most time), etc.
    The problem here is apps will continue to grow, become larger, more trailers, movies, songs embedded inside apps, etc. This problem is only going to grow. The additional problem is that they can say they have tweaked the backup programming to make it faster, just like they did in 2.0.1, but backups seem slower because there are newer better more awesome apps out!! Well that's why it doesn't look like it's faster but it's slower! They will keep doing this as opposed to solving the root of the problem by recoding the whole backup foundation as I'm suggesting from above. Backups will forever take longer and longer and longer and longer. That is what you have to look forward to. My guess is that they are not going to fix the foundation of how backups are done anytime soon having a good idea how they are doing this one. They would have to do a massive overhaul of the whole backup code, which basically they would have to admit that all the time coding this way was a waste and they see no profit from it and we deal with it just by pressing x sometimes. We can complain all we want, but for awhile if you don't want long backups, this is the real solution. What's funny is writing this email took much more time than figuring out what apple is doing, but I think this will help many apple iphone users. Let me know what you guys think.

    Supposedly apple made backups slightly faster on 2.0.1, but like I said in my original posting above...it will get worse and worse because of the apps.
    Just to verify and you could do this yourself. Right before you plug in to sync and it auto starts the backup process do this...go to the folder where all the files are as mentioned above, sort it by date modified. Add a refresh button on the toolbar. Then start the sync/backup, keep refreshing and you see the files getting updated. There are even temporary files apple's backup process creates that you don't see that keeps adding to a file, so even if you see one file updated, you might see it updated a few times until the whole backup for that file completes.
    Here are my stats:
    For me this time it took 27 minutes (earlier it took 2 minutes, but like i said with updates to apps, more apps, depending on types of apps, your computer speed, etc it will increase.
    For me: In 27 minutes, it updated 1707 files with a total size of 82.8MB. There are a ton of computers that are much faster than mine that I'm sure would cut the minutes down. I have 6 pages of apps, but like I mention above, that doesn't matter because you could have one app that has 400 files with a large size. I would be interested in others posting their results, maybe in this format:
    27min 1707files 82.8MB Pentium4HT Antivirus and other large programs running in background.
    If you are interested you can even download program that will decrypt these files so you can view them in more detail...for mac, for instance, there is something like this: http://mac.softpedia.com/get/iPhone-Applications/Tools-Utilities/iPhone-Backup-D ecoder.shtml It allows you to backup and modify. It may help you decide what is taking your backups so long and you can decide if it's worth having that app installed versus not having a good backup. You can also pick out you sms backup file, contacts backup file, etc for those really interested in having backups of those specific files.
    Hope this helps clear up things for everyone.

  • I like to know when i use fire fox why it take so much resource of my computer ? it almost 1/4 of my 4gig of memeory , ihave 6,7 page of firefox window open

    i like to know when i use fire fox why it take so much resource of my computer ? it almost 1/4 of my 4 gig of memory , i have 6,-8 page of firefox window open at cpu level its is almost 25% been used up. i see its taking too much resource i wonder why ?? how not to take so much and it crashes often.. any help,ive 24.0 ,

    Firefox add-ons take some memory. This amount varies depending on the add-on.
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    Does this decrease the memory usage? Please report back soon.

  • How to take input in arraylist in jsp using spring Frawork tags

    hi all i am using this code in my jsp using spring framework ..n in this code i am finding difficulties to take input in arraylist...can any one suggest me proper method for it
    <core:forEach items="${addUpcModel.resultList}" var="result">
    <td width="4%" class="normal"><core:out value="${result.vendorSize}"/></td>
    </core:forEach>
    </tr>
    <tr class="white">
         <td class="normal">Quantity</td>
    <core:forEach items="${addUpcModel.resultList}" var="result">
    <spring:bind path="addUpcModel.upcDO.quantityOrder">
              <td class="normal"><span class="normallink">
              <input name="<core:out value="${status.expression}"/>" type="text" size="10" maxlength="10"
              onKeyPress="return numbersonly(this, event)"
              value="<core:out value="${status.value}"/>"/>
              </span></td>
         </spring:bind>          
    </core:forEach>     
    i want to take quantity order in array format..as how many columns .it will be decide by database ...in arraylist

    af:outputText has an attribute escape which you can set try.
    You should try af:outputTextFormatted too.
    Timo

  • Why it takes long time to shut down after i upgrade to OS X ver 10.8.2?

    why it takes long time to shut down after i upgrade to OS X ver 10.8.2?

    Can't really say, but I see this occurring on all of my Macs since the 10.8.2 update and keep reading about it at several other Mac user boards.
    Bottom line: it's a general problem, but more of an inconvenience, than a serious problem. Probably will be solved with the next update.

  • Why it takes long time to download and udates for iphone4

    why it takes long time to download and updates for iphone4 ?

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Why do you need this if you are going to Oracle. Try
    removing this. It might be trying things out with the
    old driver and then moving to the new driver. This has nothing to do with it. (And it doesn't "try things out")
    >
    Also check your machines. They might be slow. There is
    no reason, it should take more than few hundred
    milliseconds to connect to a database on localhost as
    your case is.Possible reasons...
    - Network traffic
    - Faulty router/gateway
    - Busy server
    - Faulty network card (either end)
    - Conflict with another box

  • Why it takes long time (about 10 Min) to map the network drivers in windows 8.1?

    Why it takes long time (about 10 Min) to map the network drivers in windows 8.1? I don’t have this problem with any other operating systems (Ex: Windows 7 or XP)

    Can you perform a refresh ?
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Why java take enum type off

    why java take enum type off?
    When in switch statement, it become complex without enum type.
    Enum can constrained the range of integer value. Taking enum type off,
    method parameter checking will take lots effort.
    can any way to replace the functions of enum type.

    It was a disputable design decision.
    The original C "enum" type is however somewhat flawy from its lack of encapsulation (its elements "pollute the global namespace" - they are for this purpose!) and would not seamless fit into the typed, OO Java philosophy.
    Otherwise put, the original "C" enum fits well to the C philosophy but no to the C++ or Java one.

  • I don't know why it takes too long time to sample flat file.

    I don't know why it takes too long time to sample flat file.
    OWB Client 10.1
    While importing a flat file of fixed width ,
    in the screen "Flat File Sample Wizard" shows the text box number of rows with default value 200.
    I want to extend this value to 700,000.
    But, it takes too long time (over 5 hours) to sample it.
    Do you know why it is happend? or How can i fix this problem?
    Thanks in Advance.
    Regards,
    JWS.

    Hello,
    Actually flat file sampling process’ goal is to capture the structure of the file. That’s why initially the sample size is set to 200 lines.
    The question is why you are trying to perform sampling by 700000 rows? Are you expecting some change in structure beyond this mark?
    If so, and you want to capture the fact that your source file is multi – typed, your better prepare small file for sampling outside the OWB.
    Sergey

  • Hi sir and mam! i dont used my credit card to buy games in iTunes why they = take my money in my credit card.now come thousand dollars,what games for 99= .99$?i dont understan your apple store do?its not safety to used credit in = apple store,very dangero

    hi sir and mam! i dont used my credit card to buy games in iTunes why they =
    take my money in my credit card.now come thousand dollars,what games for 99=
    .99$?i dont understan your apple store do?its not safety to used credit in =
    apple store,very dangerous

    These are user-to-user forums, you are not talking to Apple here. Have you checked the purchase history on your account (Store > View My Account on yoru computer's iTunes), and have you (or anyone who access to your devices) made in-app purchases in apps and/or have you taken out any subscriptions in apps ? If not then you can contact iTunes support via this page and ask for help : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Why it takes for ever to transfer 2 to 3 minutes long videos from my iphone 5 to my pc at home

    why it takes for ever to transfer a 2 to 3 minutes video from my iphone5 to my pc at home

    Howdy brian4usc,
    Thanks for using the Apple Support Communities.
    If you'd like to import photos and videos to your Windows PC, then I'd like you to please take a look at the information in the article below.
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    Take care,
    Alex H.

  • Why does it take ages for my video files to be listed in the menu?

    I have my apple tv 2nd generation connected to my airport extreme first generation via ethernet. I have my mac mini connected to the same network (though not connected to the airport extreme) with video files and tv shows in itunes. My itunes media is stored on a hard drive connected to my mac mini and home sharing is on.
    It takes ages for my apple tv 2 to list the videos/tv shows in its menu. For example I have my films listed by genre. If I select a genre, it takes sometimes as long as 5+ minutes to list the videos within that genre.
    Can anybody help with this frustration?

    Welcome to the Apple Community.
    You probably have a problem with your LAN. If you are using wifi:
    You can download and install iStumbler to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel.

  • Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    1) The best way to relocate the iTunes library folder is to move the entire iTunes folder with all subfolders to the new path, then press and hold down shift as start iTunes and keep holding until prompted to choose a library, then browse to the relocated folder and open the file iTunes Library.itl inside it.
    If you've done something different then provide some more details about what is where and I should be able to help.
    2) Purchases on the device should automatically transfer to a Purchased on <DeviceName> playlist, but it my depend a bit on whether automatic iCloud downloads are enabled. If there is a cloudy link then the transfer might not happen. You can use File > Devices > Transfer Purchases. In iTunes you should also check out iTunes Store > Quick Links > Purchased > Music > Not on this computer.
    3) Backup the device, then immediately restore it. In some cases you need to add a restore as new device into that equation. Obbviously not to be attempted until you're sure all your media is in your library. See Recover your iTunes library from your iPod or iOS device should it be needed.
    4) I believe there is complimentary 1 incident 90-day support with hardware purchases, but no free software support for iTunes itself. AppleCare gets you a different level of support.
    tt2

  • Why are artists in music library being removed from alphabetical list once a track has been played? All artist recently played appear before 'A' in my library.

    Why are artists in music library being removed from alphabetical list once a track has been played? All artist recently played appear before 'A' in my library now rendering the search bar on right of screen useless.

    Also, why would my music play at all when I turn iTunes Match off and delete all tracks off the phone? Home sharing also disabled. It is very odd!

  • Hello, I wonder why there isn't Finnish language in the adds-on list. Could you please make it available to Firefox users. Thank youin advance. Rappe

    Hello, I wonder why there isn't Finnish language in the adds-on list. Could you please make it available to Firefox users. Thank youin advance. Rappe

    (1) Firefox's built-in post-crash page has not been a real HTML page for a long time (for example, from the time of Firefox 22, see: [https://support.mozilla.org/en-US/questions/968212 Want to save LOTS of versions of "Restore Session.xht" from the "oops ..." page for later use]). If you had this working differently with Firefox 25, that might have been created by an extension.
    You can check to see whether extensions are disabled or need an update on the Add-ons page. Either:
    * Ctrl+Shift+a
    * orange Firefox button (or Tools menu) > Add-ons
    In the left column, click Extensions. The disabled extensions cluster toward the bottom of the list. To poll for updates, use the "gear" button above the list and choose Check for Updates.
    If you used the Reset feature (or Firefox automatically did a reset due to some problem during upgrading), you will need to reinstall missing extensions. The reset feature creates a folder on the desktop named Old Firefox Data. Do you have that folder? There may be data you can recover from it.
    (2) There are many ways for history to get cleared, both internal to Firefox and external. Could you double-check your Privacy settings?
    orange Firefox button (or Tools menu) > Options > Privacy
    * The "Firefox will" drop-down says Remember History: Firefox shouldn't be clearing history, but an add-on or external software could do it
    * The "Firefox will" drop-down says Use custom settings for history: inspect the "Clear history when Firefox closes" setting to make Firefox isn't set to clear history. Also check your add-ons and consider external software.
    Firefox normally accumulates months of history. However, some of Firefox's database sizes are based on disk space available. If your hard drive is very full, Firefox might reduce the amount of history stored.

Maybe you are looking for