Difference between reference creations

What is the difference between
Object anObject;
Object anObject = null;

They are logically the same. But they are not the same.
The folliwng program does the same number of declarations twice and prints
Run time with no initalisation 579 ms
Run time with initalisation to null 2265 msYou can argue this is next to no difference, but there is a difference.
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        final int size = 500000000;
        for (int i = 0; i < size; i++) {
            Object a;
            Object b;
            Object c;
            Object d;
            Object e;
            Object f;
            Object g;
            Object h;
            Object j;
            Object k;
        long end = System.currentTimeMillis();
        System.out.println("Run time with no initalisation " + (end - start) + " ms");
        long start2 = System.currentTimeMillis();
        for (int i = 0; i < size; i++) {
            Object a = null;
            Object b = null;
            Object c = null;
            Object d = null;
            Object e = null;
            Object f = null;
            Object g = null;
            Object h = null;
            Object j = null;
            Object k = null;
        long end2 = System.currentTimeMillis();
        System.out.println("Run time with initalisation to null " + (end2 - start2) + " ms");
    }

Similar Messages

  • Difference between Reference char and template

    Hi Guys,
      Can anybody explain me what is tthe difference between  Reference char and template.
    Thanks,
    chinna
    Points will be awarded

    Reference Char:
    when a new Infoobject is referenced to another, all the technical properties will be inhereted by the new InfoObject.Also check this,
    http://help.sap.com/saphelp_nw04/helpdata/en/ff/f470375fbf307ee10000009b38f8cf/frameset.htm

  • CTM: Difference between Order creation Frame & Maximum earliness

    Hi Experts,
    Could any one please explain me the difference between Order Creation Frame & Maximum Earliness in CTM Gloabl Customizing and their implact on the planning run
    Thanks,
    Naveen

    Hi,
    Order creation frame is a variable planning parameter and has to be set in CTM profile.Using this planning parameter one can define a range within a certain demand has to be fulfilled.In other words a time frame can be set within a supply has to be planned to fulfill a certain demand.
    Maximum Earliness is maintained for Planned Orders which is the time period (in days) before the demand date, within which SAP APO can create planned orders early.
    Thanks,
    Dipankar

  • Difference between reference variable and object ?

    I am getting confused with reference variable and object ?
    1. int a; // is a variable
    2. Car c = new Car(); // is a object of car type
    Suggest me what are the difference between the two.....

    jverd wrote:
    Shelby wrote:
    Something about an interned string literal?_
    I remember something from class about the way Java treats strings that contain the same data. yawmark
    posted a link for me that cleared up my confusion. thanks yawmark.
    >>
    Can you actually point back to the original reference?Not clear what you're asking here. Nothing points to references. References point to objects.
    Goodness, correct wording is as important as getting the syntax right, isn't it? ;-} What I was trying to ask is if it is possible to point back to the same String once you change the pointer on the variable?
    And you answered my question succintly with the rest of your post. thanks jverd
    >
    String str = "abc";
    str = null;'At this point, we've lost the reference to the original String object. However, at runtime, the VM will still be maintaining it in the constant pool. For any non-constant-pooled object, as we're writing our code, we'd have no way to refer to that object again. In this case, we are able to refer to the same object later in our code by simply using the same string literal. "abc" elsewhere in our code will cause the VM to give us a reference to that same pooled String. Same goes for Integer, etc. in the range -128..127.
    However, it's not good design to rely on this. If your design requires you to later point to "the same object" (as opposed to any object of a compatible type and holding the same contents), then you should explicitly maintain a reference to it. In the case of Strings, you really shouldn't care whether it's the same object or not. All you care about is the character sequence that defines the String's state.

  • Difference between contract creation and project creation

    I am new to Oracle Projects. In Oracle Project Contracts I can see that we create a new contract. Also in Oracle Projects we can create a new Project.
    Can anyone please let me know what is the difference between creating a contract and creating a project in Oracle Projects.
    Can we create a project based on an already created contract?
    Regards

    Hi Dina,
    thanks for your reply. We are currently implementing Oracle Projects in our company where our main business is construction works.
    As you have said that a contract is a commercial agreement between the customer and the contractor. We get a Bill of Quantities(BOQ) along with the contract documents. In the BOQ all the different types of works for the project is defined along with the quantities which are known as BOQ Items. We have to quote our rates for the BOQ items. We generally perform an operation called Rate Analysis of these BOQ Items by assigning various quantities of resources that shall be required to execute each of the BOQ items. Thus we arrive at the cost of each BOQ items. Once the work gets executed, this BOQ happens to be the basis for invoicing or application to the client. So we create our budget based on the BOQ itself. We make our Business plan based on the items of this BOQ itself and also book the expenditure on these BOQ items.
    Although we create Project plan using Primavera, there is no one-to-one correspondence between activities of the project plan and the BOQ items. So we cannot really create our budget based on the project plan.
    So if we manage everything only on the basis of the BOQ items, we loose important project management related information like earned value management etc. And if we depent only on the Project plan we loose important cost related information.
    So we need to plan in such a way so that both these are fused together.
    Can you kindly advice me about how to proceed ahead with our implementationso that we can use Oracle Projects optimally for our business.
    Thanks & Regards

  • What's the difference between reference parameter and value parameter.

    hey,expert
    what parameter is reference parameter?
    when I made the import in RFC function,the message as follows:
    You have defined a reference parameter for a remotely called function module. However, only value parameters are allowed in this kind of function module.
    can any expert tell how to solve this problem?
    thank you.
    kim heum

    A reference parameter : When a parameter is called by reference, the system points to the original parameter without making a copy of it. The function module works with and, if necessary, alters the original parameter and not a copy.
    Make the parameter you have defined as "pass by Value".. There is a checkbox in the inteface definition for that..

  • Difference Between  files in FCE -

    I have the option to export in FCE to quicktime movie or export as quicktime format..... what is the difference and why?
    I want to be able to play the finished project on a dvd for TV or mac/pc
    is one better for quality?
    Does one compress it too much?
    thanks

    Did you even take a look at the article I linked to?
    From FCE, do this:
    1. Export -> QuickTime Movie (uncheck self-contained)
    2. Bring that QT movie into iDVD
    3. Make your DVD and burn it
    iDVD will encode the QT movie (reference movie) to DVD for you. Read more about the difference between reference movies and self-contained movies in the article by Larry Jordan. You don't have to worry about fitting the file on the DVD your self. As long as the video duration is under two hours (160 minutes), iDVD will take care of the compression.
    In iDVD you can choose between Best Performance and Best Quality. I would go for Best Quality. In iDVD, choose the Project-menu -> Project Info. Make sure you select the right Video Mode (NTSC for the US, PAL for Europe), and choose between the two quality options.

  • What is the difference between refernce and template

    Hi,
    i taken some keyfigure form refernce  to new keyfigure after that iam activating the info cube its showing error has Not contains ilist particular keyfigure.but all key figure are availbale in active version only.
    after that i used as template its came and activated.
    please let me the difference between reference and template.
    tahnks in advance.
    Regards,
    deva

    Hi,
    reference: no sid table, no master data, no data element, more or less just a pointer to the referenced object with the possibility to have a different name for the same thing.
    template: sid table, master data, data element, a object of it's own as a copy of the template object, but a complete other object.
    regards
    Siggi
    PS: do a search also, there are some good explanations additioally.

  • Calculate the difference between Creation date and key date

    Hello
    I want to calculate the difference between creation date of the document with key date(todays date). How can i do that in the query designer. Also then I want to restrict my key figure on this difference if it is =10..please can someone suggest what can be done
    thanks

    Hi Grame...
    For the days calculation ..
    I suggest you to use replacement path ..
    I have the reference that you can see the sample. The case of samples is also about day calculation.
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
    Hopefully it can help you a lot.
    Regards,
    Niel.

  • What  is difference between user group and reference user group?

    hi
    guys,
            what  is difference between user group and reference user group? 
    your regards
      p.suresh

    Hi ,
    Chk the link below for your clarifiacation.
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/5c/c1c81c445f11d189f00000e81ddfac/frameset.htm
    Hope it helps.
    Regards,
    Amit
    Edited by: Amit Kotwani on Sep 2, 2008 2:15 PM

  • Differences between object and object references

    What's the differences between object and object references? To me, it seems the same, but I am sure there are differences.
    Student s = new Student("Joe",20);
    s is an object of class Student. Can we say s is an object reference of class Student?
    Please clarify. thanks!!

    Student s = new Student("Joe",20);
    s is an object of class Student. Can we say s is an
    object reference of class Student?The thing you created via "new Student()" is an object. The variable you declared via "Student s" contains a reference to that object. People say all kinds of things but I find it clearer to differentiate between variables and the objects they refer to.

  • Differences between using a Object Reference and the Object itself

    Example:
    public class Myclass
    //difference between
    Myclass myobj;
    //and
    Myclass myobj = new Myclass();
    can anyone help me?

    Both lines you showed declare an object reference.
    The first one is not explictely assigned a value and
    is thus implicetly assigned the null reference (= a
    reference pointing to no object). The latter is
    initialized with an reference to the newly created
    Object (new Myclass()).
    They're both given a value of null first.
    The second one is then given a value that points to that object that was created.
    If they were inside a method, then the first one's value would be undefined.

  • Differences between rate routing and reference rate routings?

    Hello PP members:
    I would like to differences between rate routing and reference rate routings
    Thanks for your time,
    Thanks Again,
    Suren R

    Hi Mr.Suren,
    As explained by other friends Routing is used in Discrete manufacturing and Rate routing is used for REM-Repetitive manufacturing.
    In addional to these types SAP has given 2 more types
    1.Reference operation set -Used in Discrete manufacturing.
    2.Reference rate routing - Used in REM.
    If similar rate routing is been used for producing many materials,then instead of entering(these steps) in rate routing of each  material you create a refrence rate routing and you enter the work centres used and the other details.After saving you get a group counter number showing reference rate routing is saved with group XXXXXXXXX.
    When you are creating rate routing for a material say A ,after giving the name and plant details in the top you will be able to see an icon "copy from" and you can select the radio button for reference rate routing and give the group counter number. or else without giving it here you have got an option to select the reference rate routing after entering into the operation screen also.
    In that particular page in operation overview screen,there will be an icon copy,there you can click that icon and you can give the reference rate routing group counter number and very easily you can create rate routing for N number of material.
    Likewise you can use reference operation set while creating routing for a material in Discrete manufacturing.This basically reduces the time in creating routing or rate routing for materials in Discrete & REM respectively
    CA01,CA02,CA03-Create,Change,display (routing)  respectively.
    CA11,CA12,CA13-Create,Change,Display reference operation set Respectively.
    CA21,CA22,CA23-Create,Change,Display rate routing respectively.
    CA31,CA32,CA33-create,change,display reference rate routing resp.
    I hope this will help you.
    If useful reward your points.
    Thanks & regards
    Karthik.

  • What is the difference between ejb reference and ejb handle?

    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb handle
    from the client view and from the container view?
    Very Thanks!
    Stive

    Hi John,,
    1) Ejb Object Handle are nothing but a long lived proxy for the
    ejb object, using this handle user can disconnect from the Ejb Server/Container
    at any time
    and after some time using the same handle he can able to resume the conversational
    state
    with the server / container where he was been disconnected From.
    And there are currently two Handles , HomeHandle and Handle for EjbHomeObject
    and EjbObject
    Respectively. Both these handles have Persistent reference to the EJB Object
    2) Ejb Reference is used to lookup a bean from other Enterprise Bean
    Ejb reference is a nickname for the JNDI Location that you want to lookup a bean.
    your code will looks up a Home object via using this nickname
    and the deployer will bind the
    nickname to the JNDI location of its choice
    EJb Reference are declared in the deployment descriptor
    Regards
    Karthikeyan Gangadharan
    SIP Technologies, Chennai
    E-mail-ID : [email protected]
    "John Stive" <[email protected]> wrote:
    >
    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb
    handle
    from the client view and from the container view?
    Very Thanks!
    Stive

  • Difference between SAP Reference IMG & Project IMG...

    Hi SAP Gurus,
              Can anyone explain me about the difference between
              SAP Reference IMG & Project IMG...
    Thanks in advance,
    Praveen.

    Hi !
    The SAP Reference IMG contains alle the customizing functionallity of SAP.
    Within a Project IMG you can restrict the availible customizing function.
    Thinking about having an MM project. When you create an "MM" Project IMG you will only "see" MM relevant customizing functions in your project IMG.
    Regards
    Rainer
    Some points would be nice if that helped.

Maybe you are looking for

  • Managing multiple itunes accounts on a single computer

    I have an iPod and an iPad that use a single iTunes account on a certain PC. I have a second iPod that I have setup on a second computer which also has its own separate iTunes account (because at the time I didn't understand you can manage multiple d

  • Connect to hd tv

    hello, i usually use to burn quicktime movies onto dvd which i play on ordinary dvd player. but what do i need or have to do in order to play the quicktimemovie i edited in fce 4.01 1920x1080i50 directly on to my hd philips tv. what kind of cables, q

  • 4 hour battery life surfing internet?

    am i missing something here or is this normal? i was expecting 4 hours when watching movies or doing more processor-heavy tasks.. but im getting around 4 hours, 5 at best, on the internet not at full brightness. this is the 2nd charge and i got it tw

  • Problems with footage after making Sub clips

    Hey there Today I woke up to view all the subclips I had made out of my most recent project. Only today, all the footage looked more pixelated and blurry. What might of happened? When I pause the footage the quality is exactly as it was before. But w

  • No working buttons on Canoscan 9000F Mark 2

    Greetings CANON forum, This topic is about the CANOSCAN 9000F Mark2 scanner. I hope the printer category of the forum can be used for that topic. This scanner is great, but I have a small problem: "the buttons located on the scanner are not working p