Differences between clear() & removeallelements() in vectors

Hi, I just want to clarify, whats the difference between clear() and removeallelements() in vectors?
according to the apis,
clear()
Removes all of the elements from this Vector.
removeAllElements()
Removes all components from this vector and sets its size to zero.
So does it means that clear() do not reset it to zero? for what I understand and tried out, clear(0 does reset to zero as well unless I am wrong, please explain the above and if appropriate, give examples in laymana terms..
thanks in advance.

Quoting the source of Vector.java:
     * Removes all of the elements from this Vector.  The Vector will
     * be empty after this call returns (unless it throws an exception).
     * @since 1.2
    public void clear() {
        removeAllElements();
    }As you can see, the clear-method was added later when Vector was re-written to fit into the Collection API's

Similar Messages

  • Difference between cleared items,open items and all postings (FI).

    Hi experts,
    Can anybody tell me the difference between cleared items,open items and all postings for an account.
    While running corresponding bapis and transaction FAGLL03 (for GL) or FBL1N (for accounts payable) i found that in some cases all postings is less than cleared items or open items for a time period. How could it happen.According to my knowledge all postings should contain cleared items and open items.
    Please correct me..
    Thanks and Regards
    Arjun

    Hi Arjun,
    For every Billing Documnet created(VBRK/VBRP-VBELN) there will be an accounting document created in BSID/BSAD tables.
    OPEN ITEMS means the Billed/Invoice Amounts that are pending from Customers, i.e which we have to receive from Customers.
    CLOSED ITEMS means the AMOUNTS received from that customer.
    OPEN ITEMS : fetch data from BSID table Only
    CLOSED ITEMS : fetch data from BSAD only.
    ALL POSTINGS : fetch data from both BSID and BSAD.
    Hope this will help.
    Regards,
    Nitin.

  • Differences between clear case 23' and new 23'

    I am having a hard time finding the differences between the two monitors. my clear case 23' is about 2 years old.

    Hi Matt,
    First off, KEEP your older ADC display. They have much more natural color
    and don't suffer from the pinkness and blue banding on the new Aluminum.
    I have followed the discussions since August of last year and there is no
    end to the color consistency complaints. In fact, Apple has deleted over 1000 messages regarding this. Why? Hmmm. They threw out a lot of helpful
    hints that could have helped their customers.
    I personally bought and returned 7 Alum Cinema 23 displays. Some from Apple, some from Fry's, and others from UCLA Apple store.
    The case is a beautiful design but the interior is different than the old 23.
    The new ones are brighter, more saturated in color and have 2 Firewire and
    2 USB ports available.
    However, they got rid of the system/start up power button and added a power brick with cables waving all over the place.
    I hopoed they would have solved the production problem by now but it seems
    that too few people are complaining ( graphic designers/video editors ).
    I gave up and just bought a one year old Plastic 23 display for $1000.
    I love it. The only thing I don't like is that the whites are a little yellowish
    due to its lower brightness specs ( 230 nits vs. 270 nits on the new one.
    The way to see the color issues with an Alum model is to set the desktop to
    a neutral gray. Or, simply drag a small image of gray (perhaps open up the little gray jpg located in Library/Desktop Pictures/Solids) across the screen.
    The left side will look a little pink and it will change to a blueish tone as you move to the right.
    Or better yet, open the Apple display calibrator, look at the Apple icon and
    move the window to the extreme left and right.
    It is only visible clearly in these circumstances but most people don't care.
    Considering the price drops it might be nice to get a new one but all I
    know is all the motion graphics studios I work at use the old monitors.
    It also is no coincidence that this past weekend Apple sold out of refurbished
    Plastic Cinema 23 in 24 hrs, while the Alum refurbs just sat.
    Take a look at the specials. They always have something good.
    Good luck to you. Hopefully, I won't be deleted for voicing my opinions.
    I'm a diehard Mac user and really this Alum 23 monitor is the first thing I
    ever complained about.
    Ken

  • Difference between vector obj.clear() and Vector obj = null

    What is the difference between clearing the Vector object with .clear() method and assigning null value to Vector object?
    As per memory point of view, is it advisable to first clear vector and then assaign it to null for garbage collection or it doesn't make any difference.
    Vector may contains large volume of data.
    Please reply this if any one has fair idea regarding this.
    Thanks in advance.
    Deepalee

    What is the difference between clearing the Vector
    object with .clear() method and assigning null value
    to Vector object?
    Vector victor = new Vector(); //victor is a reference to a Vector object
    victor.clear(); //now that Vector object has no elements
    victor = null; //now victor is a null reference; it doesn't point to any Vector object
    //if that was the only reference to that Vector, the Vector is now available to be GC'ed.
    As per memory point of view, is it advisable to first
    clear vector and then assaign it to null for garbage
    collection or it doesn't make any difference.Hard to say. My gut says there will be no advantages to first clearing it. You'd have to try and measure.

  • Difference between F-28 and F-32?

    Hi Gurus,
    What is the difference between clearing and Payment? I mean Transaction thr' F-28 and F-32 for Account Receivable.If i have raised the invoce thr' T-code F-22 and when i receive a payment from customer how can i clear the invoice(using F-28 or F-32)? If f-28 is used then why notF-32?
    Please explain me.
    Thanks!!!!!!!!!!!!1

    hi
    F-22 is used for customer invoice
    F-28 is used for incoming payment
    F-32 is clearing customer
    some times exp : F-29 is used for customer down payment entry
                               F-39 is used for transfer of adv from s/p gl to resc a/c
                    down payment is 4000rs &
                     invoine              10000rs
       now payment is    6000rs so this kind of entries clear F-32. single payment automatically clear F-28.
    we can clear two open items in single payment throw F-32
    if it's useful plz assign points
    regards
    sivareddy.

  • Unable to clear GL due to Val difference between Local and group currency.

    hi,
    We have an open item managed Revaluation G/L account in our company code which has a local currency USD.There are some documents posted to this account in both USD and CAD. But when we analyze the docs posted in CAD we found a valuation difference in the local currency(USD) and the Group currency(again USD). I am not sure of the reason for this. But due to this difference we are unable to clear this account. Please let me know if anyone can think of how to clear this particular GL account.
    Rgds,
    Raj/
    Edited by: raj3875 on Oct 8, 2009 11:37 PM

    We have an issue even with document currency in USD. there is a valuation difference between Local currency (USD) and Group currency (USD).
    For example:
    Doc currency = 0 USD
    Local Currrency = 171,000 USD
    Group currency  = 0 USD
    Because of this I am not able to clear the account. Not sure why there is a difference inspite of the same currency. I try to clear it in F-04 but I get the below error:
    Posting is only possible with a zero balance; correct document
    Message no. F5060
    Regards,
    Raj

  • Find difference between two vectors ?

    Hi,
    I have two vectors, the first contains:
    v1.add("1");
    v1.add("2");
    the second:
    v2.add("1");
    Now I want to print out the difference between both.
    Does anybody have en idea ?
    Regards
    Micha

    Yep, that should definitely do it. I think the point ssav is trying to make is that to solve this problem we need to know your actual requirements. "the difference between" is too vague. Here are some things to think about:
    - Is position important? That is, is a List containing 1 and 2 the same as a List containing 2 and 1 or different?
    - If List A contains 1,2,4,5,6 and List B contains 1,2,3,4,5,6 what would you want to see?
    - What if List A contains 1,2,3 and List B 1,2,2,3?
    - What if List A contains 1,2,3 and Lits B 1,2,and a java.lang.NullPointerException?
    You're probably starting to see that this is not as simple as you thought. Come back with more specific requirements and you may get better help.

  • Difference between FR1(freight clearing) and FR2(freight provision)

    Hi,
    Can anybody tell me what is the difference between transactions FR1(freight clearing) and FR2(freight provision).
    thanks in advance
    Amitava

    FR1 is Used for
    *FRA1(Freight %) *
    FRB1 Freight (Value)
    FR2 is Used for
    FRA2(Freight %)
    FRB2Freight (Value)

  • PE2 - What's the difference between "cut" and "clear" in Project Assets?

    When removing items from the Project Assets area, what's the difference between "cut" and "clear"?
    Also I believe "delete" is an option at times, but I couldn't replicate it.

    Cut should Delete, but transfer that Clip to the Clipboard, where Clear will just Delete it completely - no transfer to Clipboard.
    That can be tested by doing a Cut, then move the CTI (Current Timeline Indicator) to the end of the Timeline, and hit Ctrl+V (Paste). That Deleted Clip should appear after the CTI.
    Then, clear (or choose a different Clip) the Clipboard, and try Clear. It should not Paste the Clip into the Timeline.
    Good luck,
    Hunt

  • What's the difference between keep cookies until I close firefox and clear cookie history when firefox closes?

    In the settings for Firefox 33.0 (I am using Ubuntu 14.04 but the functionality is the same for Windows 7) there are two different ways to delete cookies when firefox closes. Or at least there seems to be.
    First is the keep cookies until firefox closes
    Second is to check the box to clear history when firefox closes and in the settings check cookies.
    What is the difference between these two options?
    I usually have both setup but I was noticing that a login was not saving for td canada trust easyweb, even though I have an exception set for it. Now I unchecked to delete cookies when clearing the history on close and the login saves correctly.
    This login saves 7 cookes under easyweb.td.com and 10 cookies under td.com and I have exceptions set for both. If I clear history on close and include cookies, half of the td.com cookies are gone when I close firefox and re-open. The same is true if I don't set the exception.
    So currently I cannot figure out a way to keep all the cookies if I clear cookie history when firefox closes. What is the difference when this is enabled?

    Let all cookies expire when Firefox is closed to make them session cookies.
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: Keep until: "I close Firefox"
    Create a cookie 'allow' exception for cookies that you would like to keep.
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: Exceptions
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, passwords, and other website specific data.
    Clearing cookies will remove all specified (selected) cookies including cookies with an allow exception that you would like to keep.
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/remove-recent-browsing-search-and-download-history

  • Difference between list.clear() and new instance

    In the below code,
    List<String> test = new ArrayList<String)();
    list.add("one");
    list.add("two");
    list.add("three");
    list.clear();
    (or)
    list = new ArrayList<String)();
    list.add("four");
    list.add("five");
    What is the difference between List.clear() and creating new instance for list?

    1. Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    2. Invoking clear() sets all the elements of the ArrayList to null and resets the size to 0.    public void clear() {
         modCount++;
         // Let gc do its work
         for (int i = 0; i < size; i++)
             elementData[i] = null;
         size = 0;
        }(modCount is used to detect concurrent modification and throw an Exception when needed)
    Constructing a new ArrayList creates a new, different, empty ArrayList.
    In many situations they might be equivalent, but not in a case where you have two or more variable references to the same ArrayList. Example (watch out for typos)ArrayList<String> stringsA = new ArrayList<String>();
    ArrayList<String> stringsB = stringsA;
    : // add elements to stringsA
    : // stringsB refers to the same populated list
    stringsA.clear(); // stringsB refers to the clear()ed list
    : // add elements to stringsA again
    stringsA = new ArrayList<String>(); // stringsB still refers to the populated listdb

  • Difference between InvisibleShield, Ghost Armor, Clear Shield

    They all say that each was originally used to "used to protect the leading edges of military helicopter blades from wear and tear" or protect helicopter blades in Desert Storm from sand or something. Why are there different companies making the same exact product? I'm a bit confused on this (apparently theres some minor difference between Invisible Shield and Ghost Armor.. apparently Ghost armor's a little better)

    Let me tell you why you DO need a screen protector.
    I had a Dell AXIM for 2-3 years. Used it with an awesome screen protector (i can't remember the name, it's a static cling, washable, reusable film). I had it on the device from day one. I didn't smudge and I never had any problems until the day I dropped the device face first on a pebble getting out of my car. The protector had a dent and I thought the screen has a chip. I peeled the film of to reveal an immaculate screen without any scratches.
    Now, on the other hand, I have an expensive watch with a scratch resistant glass. I dropped that by mistake and it his something on the concrete and I had a very expensive dot on its face. Now, I don't expect anyone to use a screen protector on a watch but if $10 will maintain an immaculate screen i think it's worth it.
    Now, If I just could find the same screen protector I had on my AXIM I would buy it in an instant. It was smudge resistant too. I'm on my 4th cheap film and they either smudge or they are sticky.

  • Difference between GUI_UPLOAD and WS_UPLOAD

    Hi,
    Please make me clear about the difference between GUI_UPLOAD and WS_UPLOAD. In which cases we need to use these modules...??
    Thanks,
    Satish

    I would suggest to always use the GUI_UPLOAD.  I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES.   Really, you should probably use the class/method instead of the function module.
      data: filename type string.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_upload
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf
             exceptions
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  no_authority            = 6
                  unknown_error           = 7
                  bad_data_format         = 8
                  unknown_dp_error        = 12
                  access_denied           = 13
                  others                  = 17.
    Regards,
    Rich Heilman

  • Difference between ok_code and sy-ucomm

    Hi,
    Can any one tell me the difference between ok_code and sy-ucomm

    Hi,
    Actually OK_CODE and SY-Ucomm are the same. But experts suggest use of OK code for following reason:
    In each PAI event that a user triggers by choosing either a pushbutton on the screen or an element in a GUI status, the corresponding function code is placed into the system field SYST-UCOMM or SY-UCOMM and placed in the OK_CODE field (as long as the function code is not empty). Empty function codes are placed in neither the SY-UCOMM field nor the OK_CODE field.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

  • Difference Between SY-UCOMM and OK_CODE

    Hello ,
    What is the Exact difference between <b>SY-UCOMM and Ok-Code</b>?

    Hello,
    sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
    ok_code is generally used in screen as of I have used.  You will define the function in the screen. and you can use it in the main program.
    ok_code acts just as a temporary variable that stores the value of sy-ucomm.
    When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    Regs,
    Venkat Ramanan N

Maybe you are looking for