When should i use Collection?

If i can use Arrays of Object (of course, arrays of the same kind of object), i guess there arent any advantage in using Collection? iam right?
Regards again, Euclides.

If i can use Arrays of Object (of course, arrays of
the same kind of object), i guess there arent any
advantage in using Collection? iam right?
Regards again, Euclides.There are definate advantages to using Collections, depending upon the situation. Check out the introduction of the Collections tutorial provided by Sun:
http://java.sun.com/docs/books/tutorial/collections/index.html

Similar Messages

  • When should I use static variable and when should not? Java essential

    When should I use static variable and when should not? Java essential

    Static => same value for all instances of the class.
    Non-static => each instance can have its own value.
    Which you need in which circumstances is completely up to you.

  • J1INCHLN when should I use error control mode checkbox

    Hi Experts,
    I am using t-code J1INCHLN for creating remittance Challan.
    But in ECC6, EHP 5 there is new functionality added & no documentation available for same.
    There is one field with tick option called Error Control Mode.so when should i use this functionality.
    Can anyone help on this?
    Thanks and Regards,
    Sameer

    HI
    Please refer the note no :  1567443
    Manual Control in J1INCHLN to change currency key/doc type
    "After this, if you will run J1INCHLN, you will get a checkbox at the end
    with 'Error Control Mode' which will be selected by default. If you want
    to change document type, currency or rate during processing, you should
    uncheck it else it will take you to the last screen."
    I hope note is allready available in your system hence you are getting above cheeck box.
    If you want to change the document type and currency or rate during posting then you need use the check box.
    Regards
    Madhu M

  • Why or When should we use Execute Immediate in PLSQL??

    Hi Frnds,
    Long Ago i have received a interview question that ...
    How can U create a table in the PLSQL object(Function or procedure)?
    But the thing y should we use execute immediate?
    In which scenario we should we should use????????????
    Why or When should we use Execute Immediate in PLSQL????

    OR
    http://stackoverflow.com/questions/18375990/oracle-what-does-execute-immediate-means
    For DML you'd use it when running statements that you don't have available at compile time, e.g. if the column list is based on a selection from the user.
    In your case it's being used because DDL cannot be run as static SQL from within PL/SQL. Only certain query, DML and TCL commands are valid. Anything else has to be treated as dynamic.
    I'd say it's rare to need to use DDL from a PL/SQL block. TRUNCATE might be reasonable; if you find anything creating or dropping objects on the fly then that might be more of a concern as it can suggest a suboptimal data model.
    EXECUTE IMMEDIATE itself does not automatically commit; but if you execute DDL then that will behave the same as if you ran it outside PL/SQL, so it will commit in your case, yes.
    Incidentally, I'm not sure why your code is using an intermediate variable to hold the statement; that's useful if you want to display what it's going to run maybe, but you don't seem to be doing that. What you have could be done as:
    EXECUTE IMMEDIATE 'TRUNCATE TABLE BD_BIDS_EXT_DET';
    Thank you

  • When should you use dmg vs copy or duplicate

    When should you use dmg vs copy or duplicate

    Your answers are very helpful. They encourage me to ask the more complete and complicated question: we have a web site that was developed using iWeb several years ago. iWeb support was dropped by Apple some years ago and we moved the site to GoDaddy, but still using the iWeb software. Now we have only 1 computer which can continue to edit, add to and support our web site. Our aim is to copy as much of our material as we can so that when this computer finally dies we can salvage as much of our material as we can to resurrect our site once more. GoDaddy says they cannot help us.
    Here is my wife's web site:
    www.adajillschneider.com
    Thanks for all your time and help.
    Ron Schneider

  • When Should I use the Inner Classes ?

    When Should I use the Inner Classes ?
    What is the advantage(s) and the disadvantage(s) ?

    When I use innerclasses?
    1) Allmost allways when I need simple owner child behavior.
    2) When I need a behaviour, that is quite small, and used only once, I make it anonymous inner class. For example specialised streams and threads.
    3) Enumerations

  • When should a subclass have its own fields and when should it use its super

    When should a subclass have its own fields and when should it use its superclass' fields?
    Hi, thank you for reading this post!
    Let me use a specific example to ask my question.
    public class BankAccount {
         private double accountBalance;
         public double getBalance() {
              return this.accountBalance;
    public class SavingsAccount extends BankAccount {
         private double accountBalance;
         public double getBalance() {
              return this.accountBalance;
    }In the bank account example, both BankAccount and SavingsAccount will have a method getBalance(). Therefore, they
    both require a account balance field. My question is since getBalance() for both classes will perform the exact same
    operation, when should I omit declaring the getBalance() method and the accountBalance field in the subclass, and
    when should I include them?
    My own thought is when we never have to instantiate a superclass object (e.g. an abstract class), then we place
    common fields in the abstract superclass and have subclasses access these fields via protected getter/setters to
    access the superclass' fields. This is the principle of reuse.
    But when you do need to instantiate a superclass and the superclass does need to maintain its own fields, then
    I would need to duplicate the accountBalance field and getBalance() method in the subclass.
    Is my thinking correct or incorrect?
    Thank you in advance for your help!
    Eric
    Edited by: er**** on 22-Aug-2011 20:19

    er**** wrote:
    If SavingsAccount inherit BankAccount.getBalance()...getBalance() would return BankAccount's accountBalance. This is NOT the correct result we want.Actually, I think it's precisely what you want.
    We want getBalance() to return BankAccount's accountBalance when we use a BankAccount object, and SavingsAccount's accountBalance when we use a SavingsAccount object.I seriously doubt that. I think you're confusing a BankAccount with a Customer, who can have more than one account.
    In every system I've ever seen, a SavingsAccount IS-A BankAccount - that is to say, it's a genuine subtype. Now, it may well contain other fields ('interest'?) that a normal account wouldn't, but 'balance' ain't one of them.
    Winston

  • What are the mapfiles for and when should I use them?

    Hi,
    what are the map files for and why/when should I use them?
    /usr/lib/ld/map.noexstk
    usr/lib/ld/map.noexbss
    /usr/lib/ld/map.noexdata
    /usr/lib/ld/map.pagealign

    Hi, I'm sure you've read the comments, but for the benefit of those who haven't: /usr/lib/ld/map.noexstk # Linker mapfile to create a non-executable stack definition within an # executable. /usr/lib/ld/map.noexbss # Link-editor mapfile to create a non-executable bss segment definition # within an executable. /usr/lib/ld/map.noexdata # Link-editor mapfile to create a non-executable data segment definition # within an executable. These stop the various segments from being executable. Which could reduce the risk surface for exploiting security holes in an application. /usr/lib/ld/map.pagealign # Linker mapfile to create page-aligned data within an executable. Aligning the start of the data segment can reduce the number of TLB entries needed to map the data. So the smallest TLB page size is 8KB, then we have 64KB, then 4MB etc. If the data starts on a 4MB boundary then it can be mapped with 4MB pages, if not then it has to be mapped with 8KB pages until a 64KB boundary, then 64KB pages until we get to a 4MB boundary. You sometimes get a bit of performance from this, but you may also get performance stability from it. If the mapping is random sometimes it works well, sometimes it works less well. Regards, Darryl.

  • HT4571 When should I use data roaming?

    When should I use data roaming?

    When you are outside your carrier's network, you may be able to access the Internet using another wireless carrier, that's dataroaming.
    More info; http://support.apple.com/kb/HT1976

  • When should I use the power adapter?

    I just installed a wireless router. Should I use the power adapter when I'm not going to use the Macbook for several hours? Does the Macbook drain the battery when it is shut down or sleeping?

    When should I use the power adapter?
    Whenever you are near a power outlet. Not 100% of the time, of course (you have to flex the battery sometimes) but as often as possible.
    Should I use the power adapter when I'm not going to use the Macbook for several hours?
    If you are near an outlet, yes.
    Does the Macbook drain the battery when it is shut down or sleeping?
    When sleeping, it drains a negligible amount.
    Further reading:
    http://support.apple.com/kb/HT1446
    http://support.apple.com/kb/HT1490

  • When should I use validate(), reValidate, and inValidate()?

    When should I use validate(), reValidate, and inValidate()? Also, I would like some detailed differences on them.
    Virum

    Anyone?

  • What is the difference between saving to "Documents" and "Macintosh HD" and when should you use each one?*

    What is the difference between saving to "Documents" and "Macintosh HD" and when should you use each one?

    When you save to the folder with the little house icon, the file is placed at
    /Users/your_user_name/
    You would really have to go out of my way to save at:
    (the shortcut for the Boot Drive, regardless of its name).
    I am not sure how you decided that Time Machine is not saving your files. The default is for Time Machine to do incremental Backups of everything on all attached drives, except for certain temporary information in Cache files. If you have four Users, Time Machine will back them all up.
    Looking at the raw Time Machine backups will tell you very little, because it does lots of its work with Hard Links, and because it does incremental backups, so only files that changed since the last Backup are saved at thet cycle. The way to determine whether Time Machine is saving things is to display the window you care about in the Finder, then invoke the "Star wars"/ "Back, back, back in time" Interface.

  • When should one use final arguments?

    Hi all,
    When should one use final arguments?
    I have searched the forum for this, but couldnt find a precise answer. I am specifically looking for cases where they are:-
    1. the only way to acheive something
    OR
    2. the stylistic way to acheive something.
    Thanks,
    Binil

    My $0.02 - I don't think (practically) you ever need
    final method parameters (it's not like they prevent
    subclassing or anything). However, I think (stylistically)
    you should make method parameters final wherever you
    can - it makes the code a more explicit (the contract
    between the invoker and the invokee is clearer).
    I seem to recall something about JVMs being able to
    optimize methods with final parameters better too, but that might just be moonshine or more people would
    (probably) be going on about it.

  • DiskWarrior - Will it work, and when should I use it?

    I apologize for this dumb question, but have no time to read 50 pages of the DiskWarrior manual.
    Actually I have few questions, and hope someone will help. I got my iSight few days ago, and at the same time found in a shop here, in Beijing, DiskWarrior (which is not so easy to get in China). Being exited about getting the new machine, and having in my mind that I want it to work properly this time, I just bought it (and payed quite a lot for it 140 us$!!!) without giving it a good thought previously and mainly because everybody speaks about it as "the must" for every Mac, and now I feel stupid and need to ask:
    1. this is a v. 3.0.3, (CD rev. 38) - will it boot from my iSight at all?
    2. when actually do I use it, when I realize that there is a problem in my system, or should I use it as a maintenance program?
    Thanks a million.
    Zo

    Hey Zorana. I too had your problem. Here is the text of an email I received from Alsoft, maker of DiskWarrior.
    The DiskWarrior CD that you currently own contains DiskWarrior 3.0.3
    which will work with Mac OS X 10.4.x (Tiger). However, whether or not a
    DiskWarrior CD will start up a computer is based on the model of the
    machine, not on the operating system that is installed on the internal drive.
    In most cases, older DiskWarrior 3 CDs cannot start up newer machines
    because they do not have the necessary System files. To start up the
    iMac G5 (with built-in iSight) models that were released in October 2005,
    you need a DiskWarrior CD with a more current operating system.
    An Update CD (revision 39) with the latest startup System (Mac OS X
    10.4.x "Tiger") and DiskWarrior 3.0.3 is available for order by calling
    our Sales Department at 800-257-6381 (US Toll Free) or at 281-353-4090
    (International). The cost for the Update CD is US$12.95 plus US$7.95
    shipping & handling fees.
    Finally, if you have purchased DiskWarrior in the last 30 days, we will
    send you a CD for the price of shipping.
    In the interim, you might utilize one of the following methods to run
    DiskWarrior:
    (1) Alternate Startup Disk: If you have another drive (such as an
    external FireWire drive or an iPod with FireWire) you could install OS X
    (the version which came with your computer, or newer) on that drive and
    then start from it. Install DiskWarrior on that drive's "Utilities"
    folder, (which is inside the "Applications" folder) and run DiskWarrior
    from there.
    (2) Target Disk Mode: Connect two Macs with a FireWire cable where the
    one is the "host" and the other is a "target". The host Mac should be
    running OS X (10.2.1 or higher). In this scenario, the target Mac is the
    new iMac that cannot be started from the DiskWarrior CD. Start by
    shutting down the target Mac. Then turn it on while holding down the "T"
    key. The target Mac's drive will appear as a usable drive on the host
    Mac. Run DiskWarrior from the host Mac and rebuild the target Mac's disk.
    -- Marc
    I hope this helps.

  • When should you use widgets rather than advanced actions?

    HI,
    We have a few very complicated projects using lots of advanced actions and widgets that simulate laboratories.
    1/ Should you always use advanced actions if it possible OR
    2/ Should you use widgets when you reach a certain level of complexity ?
    Are there any differences in the field in terms of reliability ?
    regards Renovator

    Hi Renovator
    I'll take on the last thing you asked about. Differences in terms of reliability.
    Unfortunately the answer to that one is actually a question.
    The question? How long is a piece of string?
    Of course the answer to that is "it depends". Likewise, whether an Advanced Action or a Widget is more "reliable" depends on how the code was implemented. Folks can create Advanced Actions that don't work as they think they will. The same can be true of widgets. So I'd say that they are on equal playing ground when it comes to "reliability".
    Cheers... Rick

Maybe you are looking for