How many objects will be created due to constructor chaining

Consider this case
ChildClass obj = new ParentClass();
I would like to know how many objects will be created in this process.

Consider this case
ChildClass obj = new ParentClass();
I would like to know how many objects will be created
in this processThe simple answer is one.
The complex answer is many.
In terms only of the classes that your code represents conceptually there will be one.
The reality is that the the object itself might create objects. And loading the classes, if it has not already occurred will also create objects.

Similar Messages

  • How many homeobjects will be created when we deploy a ejb

    when we deploy ejb(session) in the server how many home objects the server will create and if multiple clients request the same beanhome object how the server will maintain plz anybody help me out

    One String object is created when the class is loaded.
    No objects are created when that line is executed.

  • How many partitions will be created for range 1998-2000

    hi experts,
    i have created partition on a infocube with range as 1998 to 2000 im able to see 37 partitions only in DB02 transaction.
    i read  in saphelp document that 38 partitions will be created.
    i.e <1998 and >2000
        3 x 12 = 36 +2 = 38
    but for me all records < 1998 are placed in partition 199801 and max value partition is created i.e >2000.
    so please can anyone explain why this is happening.
    Regards,
    Venu Gopak.K

    Hi Venu,
    Found note 385163 - Partitioning on ORACLE since BW 2.0.
    This has the following logic for creation of partitions. You can see that the first partition "/BIC/EPART_BSP200001" is created to take in the values of Jan 2000 and below (less than Feb 2000).
    The table "/BIC/EPART_BSP" is created as follows:
    CREATE TABLE "/BIC/EPART_BSP" ( ..... , SID_0CALMONTH , .... )
                  storage ( INIT , ...., ....... )
                  partition by range ( SID_0CALMONTH )
           PARTITION "/BIC/EPART_BSP200001" VALUES LESS THAN (200002),
           PARTITION "/BIC/EPART_BSP200002" VALUES LESS THAN (200003),
            PARTITION "/BIC/EPART_BSP200211" VALUES LESS THAN (200212),
    PARTITION "/BIC/EPART_BSP200212" VALUES LESS THAN (200213), PARTITION "/BIC/EPART_BSPMAXVALUE" VALUES LESS THAN (MAXVALUE)
    Interesting...the help docu says there will be 2 additional partitions. The note suggests there will only be 1 additional partition.

  • How can I see how many objects will be syncronized to Windows Azure

    Hi
    How can I count the number of objects DirSync will syncronize to Windows Azure Active Directory (Office365)
    I wan't to know this number before installing DirSync so I can decide if we can use SQL express og we need the full SQL server install ?

    The Office365 Deployment Readiness Tool will tell you this.
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

  • How many Objects created??

    Hi Friends,
    I am really confused with this question,can someone please tell me how many objects would be created by the following code??My answer is two("java" on the heap and the normal new String() Object),am i right???
    public class Objects{  
    public static void main(String[] args)    {   
        String one = "Java";    
        String two = "Java";   
        String three = "J" + "a" + "v" + "a"; 
        String four = new String("Test");  
    }Thanks

    Probably not, since all the operands are string
    literals. The compiler probably sees that and instead
    generates the same bytecode that it would have if it
    had been coded as: "Java" in the first place. But
    again, still stupid and pointless.just what i wanted to say but was a bit slow. maybe it's stupid and pointless,
    but for grins, i am attaching the constants pool from the class file that was
    obtained by compiling the code in post 1 with Sun's compiler. I don't see any
    "J" or "a" or .........
    pool index: 1 type: 10 class index: 7 name index: 16 value: null
    pool index: 2 type: 8 class index: -1 name index: 17 value: null
    pool index: 3 type: 7 class index: -1 name index: 18 value: null
    pool index: 4 type: 8 class index: -1 name index: 19 value: null
    pool index: 5 type: 10 class index: 3 name index: 20 value: null
    pool index: 6 type: 7 class index: -1 name index: 21 value: null
    pool index: 7 type: 7 class index: -1 name index: 22 value: null
    pool index: 8 type: 1 class index: -1 name index: -1 value: <init>
    pool index: 9 type: 1 class index: -1 name index: -1 value: ()V
    pool index: 10 type: 1 class index: -1 name index: -1 value: Code
    pool index: 11 type: 1 class index: -1 name index: -1 value: LineNumberTable
    pool index: 12 type: 1 class index: -1 name index: -1 value: main
    pool index: 13 type: 1 class index: -1 name index: -1 value: ([Ljava/lang/String;)V
    pool index: 14 type: 1 class index: -1 name index: -1 value: SourceFile
    pool index: 15 type: 1 class index: -1 name index: -1 value: Objects.java
    pool index: 16 type: 12 class index: 9 name index: 8 value: null
    pool index: 17 type: 1 class index: -1 name index: -1 value: Java
    pool index: 18 type: 1 class index: -1 name index: -1 value: java/lang/String
    pool index: 19 type: 1 class index: -1 name index: -1 value: Test
    pool index: 20 type: 12 class index: 23 name index: 8 value: null
    pool index: 21 type: 1 class index: -1 name index: -1 value: Objects
    pool index: 22 type: 1 class index: -1 name index: -1 value: java/lang/Object
    pool index: 23 type: 1 class index: -1 name index: -1 value: (Ljava/lang/String;)Vwalker

  • How many copies of the object will be created?

    Hi folks,
    Would anybody tell me how copies of the String objects will be created in the following examples?
    List list = new ArrayList(3);
    list.add("1");
    list.add("2");
    list.add("3");
    //example 1
    String str1 = null;
    for (int i=0; i < list.size(); i++) {
    str1 = (String)list.get(i);
    //example 2
    for (int i=0; i < list.size(); i++) {
    String str2 = (String)list.get(i);
    Thanks!

    Example 2 is better style because a variable should be declare in the narrowest possible scope.
    This,
    String str2 = (String)list.get(i);
    actually is a composite statement equivalent to,
    String str2; // variable declaration
    str2 = (String)list.get(i); // assignment to variable
    So you do two things. You declare a variable, and you assign it a reference.
    In a high level language the only thing you decide when you declare a variable is its type and its scope. You cannot determine when and where the compiler is to allocate memory for the variable. There's no penalty to declaring a variable inside a loop. The compiler will NOT somehow recreate the variable in each iteration.

  • How many Objects are created in this?

    Hi,
    How many objects are created in the flwg code:
    String str = new String("Hello");
    String str2 = "Hey there";
    str = str + str2;

    Depends if you're counting objects created at compile time.
    "Hello" is created at compile time. That's 1.
    new String("Hello") creates a new String object at runtime, pointing its backing array at the "Hello" in the constant pool. That's 2.
    "Hey there" is created at compile time. 3.
    str + str2 I might do everything at compile time, or it might do some at runtime. I don't know if str is considered a compile time literal here. I think not, but I'm not sure. You can check by using javap. If I'm correct, then at runtime you'll create a StringBuffer (4) and another String (5).
    So I'd say 5 objects. But if the compiler treats str as a literal and therefore can do the str+str2 at compile time, then it might do so without creating the StringBuffer. Or it might still create it at compile time, use it, and throw it out.

  • How many objects are created?

    I have this question which some one posted to me.
    He asked me how many objects are created when an object of a simple class is created for example
    class A{
    public static void main(String args[])
    A a1 = new A();
    Now how many objects are created? I think only one. Can anyone tell me if any other objects are also created.
    Plz tell me .

    No, the answer is indeed 1. All the other objects
    (including the String[] in the main method
    parameters) are created outside of the A
    class, either by the JVM itself or by some other
    class that calls the A.main() method. You can try
    this out for yourself by adding a constructor such as
    A()
    System.out.println("Creating class A");
    } and see what prints out.Take a closer look at the question:
    how many objects are created when an object of a
    simple class is created for exampleIt doesn't say "how many objects of type A are created".
    I.e. The VM has to load class A before you can create an object from it, and thus an object of type Class is created. There are also a bunch of other objects which needs to be created before you can instantiate A.
    Kaj

  • How many ways we can create an object?

    how many ways we can create an object?

    rcnraju wrote:
    how many ways we can create an object?Why does it matter?
    add: clazz.newInstance();
    add: clazz.getConstructor(parameterTypes).newInstance(parameterValues);
    add: Unsafe.allocateInstane(Class clazz);
    add: any native method can create a new instance,

  • How many SECONDARY INDEXES are created for CLUSTER TABLES?

    how many SECONDARY INDEXES are created for CLUSTER TABLES?
    please explain.

    There seems to be some kind of misunderstanding here. You cannot create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
    All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
    Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
    In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
    If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent).

  • How many pushbuttons u can create in application toolbar in selection scree

    Hi
    How many pushbuttons u can create in application toolbar in selection screen? 
    Thank You

    Hi,
    Use SET PF-STATUS 'ZABC'.
    Double click on it.
    It will display Application toolbar. Create the buttons.
    I think the limitation is bcz of the LABEL of button, if you create buttons with a Single TEXT, then you would be able to create many buttons, including toggle button. The Toggle button would switch the buttons.
    i.e say initially 10 buttons are displayed along with toggle button. You click the toggle button , then remaining 10 buttons are displayed.
    Best regards,
    Prashant

  • I need to know how many objects i got selected

    Hi all,
    I need to know how many objects i got selected for a particular issue and ussualy are too many to count one by one. I know that this information is provided in other software like Corel or Freehand, but I didn't find out how to get this info in Illustrator.
    Any idea?
    Thanks

    Open the Document Info palette.
    From its flyout menu, turn on Selection Only and Objects.
    The palette will not remember those settings. You have to re-select them every time you relaunch Illustrator.
    The Document Info palette is a half-baked hack, tagged-on to display a subset of the information in the normally-hidden programmer's window, instead of incorporating the data properly into the program's interface. So it's another completely unintuitive grab-bag of important information that everyone needs, but no one would expect to look for there.
    JET

  • How many heirachies can be created using one dimensional table

    Hi,
    I have one dimension table and one fact table, how many heirachies can be created, is it only one?
    Thank you.

    Hi,
    One dimension can have only one hierrarchy for sure.But create dimension in a such a way(columns should be included in one dimension,example: Year and FYear in Time Dimension) that we can create two branches on Total level.
    Refer this blog..Will solve your doubt....http://gerardnico.com/wiki/dat/obiee/hierarchy#defining_multiple_hierarchies_for_the_same_dimension_logical_table
    Regards,
    Srikanth
    http://bintelligencegroup.wordpress.com

  • How Many WebSItes can I create

    I already created a web site but I´d like to create a new one. Is this possible without erasing the first one? How many sites can I create?

    Welcome to the Apple Discussions. Yes. Create a new site in iWeb and rename it to whatever works best. When you publish the URL will be: http://web.me.com/YourMMe_Account_Name/SiteName/
    You can have as many sites as you have room form. I have over 85 individual sites in my MMe account.
    OT

  • How many vlan can be created on single port of HWIC-2FE

    Hi Guys,
    I have a router 1921 with a HWIC-2FE.
    How many VLAN can I create in each port of HWIC-2FE.  
    Thank you
    Salvo

    I'm not sure what you are referring to. How many VLANs can be untagged while the port is in access? Or how many VLANs can you pass on a trunk?

Maybe you are looking for

  • Odd MSN traffic behavior

    Hello Forum, we are rolling out web filtering and I am troubled by websites that are legit and allowed by policy, not connecting. S360, latest released code. One is site www.msn.com. We have done some sniffing around the device. When I go to it and s

  • How to get back lost contacts

    I woke up Sunday and list all my contacts & colander events were gone.  How do I get them back? Help.

  • Milestone billing with Partial Dispatch

    Scenario.. 1) The material we have is a large machine tool 2) We create a sales order for stage wise payments and raise down-payment requests for the advance and various stages of manufacture. 3) The M/c is assembled and checked for performance... 4)

  • Can I get a new charger for free for my MacBook Air

    Just a question I think mine broke

  • Mr. don wiliams help me

    hello Mr don i want add new textbox without in crystal report10 devloper i want  with vb.net 2005 i use this code:         Dim crxApp As New CRAXDDRT.Application         Dim crxReport As New CRAXDDRT.Report         Dim myText As CRAXDDRT.TextObject