Suggestion on collections and object creation

Hi I need to read some data from the Sybase database and make some statistical computations( average, standard Deviation, min/max) for monthly period.
The data looks like the following:
Name Score Date
John 100 06/20/2009
Mike 200 05/23/2009
Performance is very important, what is the best way to store that information in a java collection ( I think using ArrayList is the fastest) do you think I need to create an object for each row of information with private fields name, score, date? or is it too time consuming to create objects and store it in an ArrayList?
I just need to do those calculations above and display it. So, how would you recommend me to do that? If I want best performance (to be fast)
Thanks.

Hi thanks for help,
The thing is, I need all the data if the user wants to see Details, then I will need to display all rows. On the other hand, Sybase doesnt have the stdev function, I wrote a query that calculates stdev, but I will need to run the query once for each person, because it looks like this:
select
(SQRT((sum((MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
From MyTableNameWhere
MyWhereCriteria and
abs(MyFieldName)>0))*(MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
From MyTableNameWhere MyWhereCriteria and abs(MyFieldName)>0)))) /(select count(MyFieldName)-1
from MyTableNamewhere MyWhereCriteria))) 'StDev'
from MyTableName WHERE MyWhereCriteria
where MyWhereCriteria would be
where date = '07/03/2009' and name = 'John'
so some of the subqueries return multiple rows which is a problem..
I got error saing:
[Error] Script lines: 13-30 ------------------------
Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <= , >, >=, or when the subquery is used as an expression.
Msg: 512, Level: 16, State: 1

Similar Messages

  • JVM 1.5.0, parallelism and object creation

    Hi.
    I am currently running Java 1.5.0 on a production server. This server is a 4-cpu 2gb ram beast running Red Hat ES 3. It provides MySQL backend and a Java server to be accessed through a Flash client.
    So far, the Flash client fares well. MySQL takes worst cast 16% of one CPU for very heavy selections. But I am having problems with optimizing the Java part that does everything.
    First and foremost, I cannot change the way it is. Our java code is mostly vendor code, thus we can't really expect to be able to easily change the code. Whatever code we added to the vendor code is definitely not the bottleneck, it's optimized, it's properly synchronized and it's very effective.
    I would like to give you an idea of how things fares. You will see my problem soon.
    - I am running one process of Java. This process is -Xms and Xmx'ed to 384 megs.
    - The total DSize of the Java environment is more than a gigabyte due to the 1000+ threads that runs through it. More so, every client that runs through it adds up at least two threads.
    - There are massive object creation and destruction happening. For a 100-client system, the "eden" memory is filled up and GC'ed at least twice per second. Since 1.5.0, the "old" memory of 384m gets filled up in 10 minutes, and GC'ed at that point.
    - CPU usage is having fun between 80% and 150% of one CPU (remember I have 4 CPUs so 150% is 150/400% total usage)
    - GC is the major speed bump for my server, as if I put 768 megs of Xmm instead of 384, cpu usage drops to 60%-90% CPU, that is, until memory gets filled up and swap gets used (do the math: 768m + 1200 thread stacks)
    Now it works fine. 100 users, it's perfect. My major problem is that from next week on, we are planning 300+ users. Ouch.
    So my few questions are:
    - In knowing that garbage must constantly be collected, is there something I can do in the environment to make it happen all the time in background? Or am I bound to have all 4 cpu's stopped momentarily twice per second so that it might happen?
    - In 1.4.x, I could change "eden" memory block size. It doesn't seem to be the same for 1.5.x. What's up with that? I used to increase it dramatically, making GC longer but less frequent, increasing parallelism force.
    I am asking the questions because I am not in position of trying "what if"s with my production server. The test server handles well our 8 internal users ... but we are not close of making the same amount of request as our 100-users production server... so we cannot reliably try out options. Best case is see if it crashes or now.
    Thanks
    Mike

    Mikle -- please make sure that you are using either the
    UseParallelGC collector or the UseConcMarkSweepCollector.
    Both would appear to address some of the problems you
    mention.
    You may need to tune the size of the young generation
    explicitly. Check out the GC tuning documents/tips
    at:
    http://java.sun.com/docs/hotspot
    You should make sure your application is not paging.
    Since the default thread stack sizes are large (2 MB?)
    and you may not need that much, you can try -Xss256k
    (for example) to reduce the virtual memory requirements
    for your thread stacks and free up more address space
    for the Java heap.
    In the end, for an application of the kind you describe you
    probably need to go 64-bit and use a larger Java heap
    along with the parallel/concurrent collector to deal with the
    attendant GC overheads. That (going 64-bit) should be easy
    (trivial) if your application is pure Java.
    Hi.
    I am currently running Java 1.5.0 on a production
    server. This server is a 4-cpu 2gb ram beast running
    Red Hat ES 3. It provides MySQL backend and a Java
    server to be accessed through a Flash client.
    So far, the Flash client fares well. MySQL takes worst
    cast 16% of one CPU for very heavy selections. But I
    am having problems with optimizing the Java part that
    does everything.
    First and foremost, I cannot change the way it is. Our
    java code is mostly vendor code, thus we can't really
    expect to be able to easily change the code. Whatever
    code we added to the vendor code is definitely not the
    bottleneck, it's optimized, it's properly synchronized
    and it's very effective.
    I would like to give you an idea of how things fares.
    You will see my problem soon.
    - I am running one process of Java. This process is
    -Xms and Xmx'ed to 384 megs.
    - The total DSize of the Java environment is more than
    a gigabyte due to the 1000+ threads that runs through
    it. More so, every client that runs through it adds up
    at least two threads.
    - There are massive object creation and destruction
    happening. For a 100-client system, the "eden" memory
    is filled up and GC'ed at least twice per second.
    Since 1.5.0, the "old" memory of 384m gets filled up
    in 10 minutes, and GC'ed at that point.
    - CPU usage is having fun between 80% and 150% of one
    CPU (remember I have 4 CPUs so 150% is 150/400% total
    usage)
    - GC is the major speed bump for my server, as if I
    put 768 megs of Xmm instead of 384, cpu usage drops to
    60%-90% CPU, that is, until memory gets filled up and
    swap gets used (do the math: 768m + 1200 thread
    stacks)
    Now it works fine. 100 users, it's perfect. My major
    problem is that from next week on, we are planning
    300+ users. Ouch.
    So my few questions are:
    - In knowing that garbage must constantly be
    collected, is there something I can do in the
    environment to make it happen all the time in
    background? Or am I bound to have all 4 cpu's stopped
    momentarily twice per second so that it might happen?
    - In 1.4.x, I could change "eden" memory block size.
    It doesn't seem to be the same for 1.5.x. What's up
    with that? I used to increase it dramatically, making
    GC longer but less frequent, increasing parallelism
    force.
    I am asking the questions because I am not in position
    of trying "what if"s with my production server. The
    test server handles well our 8 internal users ... but
    we are not close of making the same amount of request
    as our 100-users production server... so we cannot
    reliably try out options. Best case is see if it
    crashes or now.
    Thanks
    Mike

  • Interface suggestion for Collections and Presets windows

    Hi,
    I would like to suggest you an improving of the left part of the main screen. I wish - maybe one day - that you can modify the management of collections, presets, etc...
    When you have a lot of Presets and Collections, and we need to switch between them asap, it's very difficult to scroll all of the list (...the scrollbar is also on the left ! Strange idea...)
    The best idea will be to redraw the actual design : in that case, the title bar and their "contextual menu" still always visible.
    A simple mouse clic would allow to uncollapse Collection or Presets lists very quickly on the top. All titles won't be never hidden.
    Please, take a look at my screen capture (my suggestion) for a better explanation.
    Thanx.

    Hi thanks for help,
    The thing is, I need all the data if the user wants to see Details, then I will need to display all rows. On the other hand, Sybase doesnt have the stdev function, I wrote a query that calculates stdev, but I will need to run the query once for each person, because it looks like this:
    select
    (SQRT((sum((MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
    From MyTableNameWhere
    MyWhereCriteria and
    abs(MyFieldName)>0))*(MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
    From MyTableNameWhere MyWhereCriteria and abs(MyFieldName)>0)))) /(select count(MyFieldName)-1
    from MyTableNamewhere MyWhereCriteria))) 'StDev'
    from MyTableName WHERE MyWhereCriteria
    where MyWhereCriteria would be
    where date = '07/03/2009' and name = 'John'
    so some of the subqueries return multiple rows which is a problem..
    I got error saing:
    [Error] Script lines: 13-30 ------------------------
    Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <= , >, >=, or when the subquery is used as an expression.
    Msg: 512, Level: 16, State: 1

  • UI API Collection vs Object

    Hi there, what is the main purpose that the objects' structure for the SAPbouiCOM.dll are divided into collection and object itself... why we need collection (eg. Form Collection and Menu Collection)?
    Thanks.

    Hi,
    These collections are very useful as they contain all the instances of the object in the SBO application when the UI API addon is running. For example, if you want to be able to see which forms the user has open within the SBO client, you can use the Application.Forms collection to iterate through the open forms. Without this collection, you'd have no way of knowing what the user had open. The menu collection is arguably less useful but there are circumstances where you need to iterate through the menus to find if a particular menu id exists.
    Kind Regards,
    Owen

  • How to collect and transport a hierrachy linked to an object ?

    Hi guru,
    I am working in BI 7.0  and  linked a Hierarchy to oan object.
    When I transported the object to production, the hierarchy is missing in production.
    How to collect and transport this hierachy  ?
    In case of a user-defined hierarchy, is it possible to transport it or  have I to re-create in prod ?
    Thanks for your support

    hi ,
    Yes we can create hierarchy in production .
    But if you have some kind of infrastructure build for data laod , that needs to be separately migrated.
    The Info-object with the Hierarchy check in maintaineance window of info-object should be migrated to production  in order to naually maintain the hierarchy in Production
    Thanks
    Mukesh

  • E-recruitment objects NA, ND and NE creation

    Hi,
    I need some clarification on E-rec Objects as I am developing one report. Wherein, I want to pull out all the candidates those are applied for that particular requisition.
    When I give the logic on NA to ND relationship which gets created in HRP1001 then if recruiter has search for candidate in candidate search and pull the candidate and applied to the requisition in that case, the ND has not created for that candidate.
    I have seen one case wherein candidate has applied for a requisition and then  withdrawn the application in that NA to ND has created in HRp1001 but NE is not appearing for this case.
    Kindly give some clarification on these object creation.
    Regards,
    Sarika

    Hi Sarika,
    Please keep in mind that there are cleaner ways to exploit the data model of e-recruiting and that is almost never required to access database tables directly.
    Most relevant classes can be found by searching with pattern CL_HRRCF*BL. This search will give you a list of all business logic classes. Most of the times, these classes contain methods which will also return the text labels for most key fields.
    Regards,
    Luk

  • Any API to get a collection of object and it's property in a page

    Just wondering whether Oracle provides any API which is able to return a collection of object in page and then I can read the object name and its attributes. If such API exists, it will make my life easier to code the logic because I don't have to hardcode the object name.

    I found the solution myself:
    Using a cursor of
    select ITEM_NAME, LABEL from APEX_030200.APEX_APPLICATION_PAGE_ITEMS
    where
    workspace=[Workspace Name] and
    application_id=[APP_ID] and
    page_id=[PAGE ID]
    order by
    display_sequence;
    Then I can use v("ITEM_NAME") to find out the values of each page item. With this method I don't have to hardcode all the item name in the PL/SQL code. e.g. If I want to validate a page that all items cannot be empty, I can use this way, rather then creating multiple validation rules.

  • Reconciling garbage collection, heap overview, and object stats

    First, both the JRockit RuntimeAnalyzer and Console are great tools. We use
    them extensively so thank you.
    I'm trying to reconcile the numbers in these three tabs.
    1. How do I reconcile the Runtime Analyzer and Console output?
    - The Heap overview tab in our application profile shows Heap Overview as
    83% free.
    - However, the Garbage Collection tab of the profile and Console shows the
    application as oscillating between 50 Meg and 200 Meg of heap used. That's
    25% (50Meg/200Meg) to 100%(200Meg/200Meg) used. How do I interpret the 83%
    vs. the 100%?
    I don't believe the 83% free, but I'm skeptical that we consume 150Meg of
    memory in 50 seconds.
    2. How do I reconcile the Object stats with the Garbage collection?
    - Take the top heap user at end of recording, character buffer. It's 22.8%
    of heap using 6,328 KB. If the heap is actually only 34Meg ( 17% of 200Meg.
    I get the 17% from the 83% free), then 22.8% makes sense.
    - So what's in the 200Meg of heap?
    I sent this recording to the JRA team if you want to look at it.
    Thanks
    Jeff

    I've never heard it put that way. Very interesting.
    "Johan Walles" <johan@spamalamadingdong> wrote in message
    news:41bf0be3@mail...
    Note that the time it takes for the garbage collector to do its thing
    grows with the amount of live data.
    What the garbage collector really does is more like retaining the live
    data than disposing of the garbage.
    Regards //Johan
    Jeff wrote:
    Staffan,
    Thanks - you clearly answered my questions. Now the follow-on questions:
    1. Is there a way to get insight into what the 'dead' data is composed
    of?
    2. Is this pattern of consuming 3x the live data in about a minute
    'typical' or a disaster in the making?
    I'm trying to get a sense of what a reasonable target of 'dead' data is.
    The system processes about a meg of data per second, including database
    writes.
    Thanks
    Jeff
    "sla" <[email protected]> wrote in message
    news:33533893.1102952170368.JavaMail.root@jserv5...
    Hi Jeff,
    I'll try to answer the questions.
    1) The Heap overview in the application profile is a snapshot of the heap
    at the end of a garbage collection. At this time only live data is still
    on the heap. So it looks like you have 17% of the heap filled with live
    data (and some overhead as seen in the Heap overview).
    In the garbage collection tab you can see the heap usage oscillating
    between 35-40MB and 200MB. The lower value is right after a garbage
    collection and the higher value is right before a garbage collection. The
    garbage collector clears out about 160MB of "dead" data from the heap.
    This is the amount of temporary objects that you created during the
    garbage collection cycles.
    2) The Object statistics are also taken right after a garbage collection.
    At this time there is 34M of live data on the heap and of these about 22%
    is taken up by character arrays (not unusual).
    At this time the rest of the 200MB heap is empty. It's been cleared of
    all temporary objects and is ready for allocation of new objects.
    I hope this answered your questions.
    Regards,
    /Staffan

  • Reg : object creation for controller and view ?

    hi friends....
    i am new to WDA and objects...
    please explain me..
    when i create the web dynpro component one interface is automatically created as IF_COMPONENTCONTROLLER for component
    IF_MAINVIEW for view
    IF_WINDOW for window
    correct me if i am wrong
    suppose if i want to reuse class, i want to create object... like wise
    if i want to reuse interfaces, i want to create object.
    but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    regards
    deva

    >but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    No you don't have instantiate any of the objects.  Think of Web Dynpro as a modeling layer implemented in ABAP Objects, but sitting on top of the Object Oriented constructs.  You still have some of the benfiits of OO - like event registration, inheritance, methods, etc - but a lot of the OO setup is done and maintained by the framework for you.  So although each section of Web Dynpro - the component, the controllers, contexts, views, etc - are all technically ABAP Object instances, you don't have to manage the objects directly.

  • File-to-file or File-to-RFC for Automatic PO creation and GR creation

    Hi,
    We are on XI 3.0 and the following has been put to me:
    We will receive a .CSV file from FTP server, into XI and then need to create Purchase Orders followed by the Goods Receipt documents in R/3 based on the incoming data.
    Further to this, the requirement is to give a log of the successfule and failed PO + GR document summary to the business.
    The programme in R/3 will compare the incoming file nmame with archived files already processed and will reject any files with duplicate names.
    I was suggesting to go with the file to RFC in R/3 whereby we can have a Z shell BAPI to include the standard BAPI for PO creation and GR creation. This Z code can then be extended to email the log to the business of which records were successfully created and which failed.
    However, I am stumped as to how can I make the file duplication comparison on R/3 as the incoming file will also be stored on R/3 archive somewhere.
    Can this be made when the BAPI is called in XI?
    I can configure alerts when the BAPI is mapped from incoming file for that interface.
    What was suggested also was to pick up the CSV file and thow it as it is in R/3 and then the Z code can go through it and create the PO and GR objects. However, then it does not make much sense to use XI as the middleware platform.
    Please advice.
    Regards,
    Arcahna

    Hi Archana,
    Take a look to this blog: 
    https://wiki.sdn.sap.com/wiki/display/XI/Different%20ways%20to%20keep%20your%20Interface%20from%20processing%20duplicate%20files
    Maybe it could help you for the duplicate files.
    Regards,
      Juan

  • Object creation of string

    Hello
    Please tell me what is the difference between these two object creation of string.
    String str = new String("Hello");.
    String str="Hello";
    Thanks.

    RGEO wrote:
    hello,
    Is the string pool is part of a heap? Huh? I suppose yes, you could regard the String pool as part of the heap... but (I guess) that interned String objects would be placed directly into the permanent generation, which is not garbage collected... and therefore I don't really think of the permanent generation as part of the heap (except when tuning heap allocations)... but I think I'm talking over your noob head here, yes... and so to the noob-stuff.
    If you get bored you might like to scan (for now) http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#generations ... and come back to it in a couple of years time (when every second word isn't new and baffling to you;-)
    jvm what will do when he encounter the following code,
    String s1 = new String ("hello");The VM will:
    1. Create a new String object, and then
    2. copy the characters 'h','e','l','l','o' from the interned String "hello" to the new String,
    3. and then assign a reference to the new String to variable s1.
    Note that the result is subtley different from String s1 = "hello", which just does step 3... it assigns a reference to the existing interned String object "hello" to the variable s1... it does not create and "populate" a new String object.
    Try this just for fun... what is the output of the following program? Why?
    package forums;
    public class StringEquals
      public static void main(String[] args) {
        try {
          String a = "Hello";
          String b = "Hello";
          System.out.println("a==b is "+(a==b));
          String c = new String("Hello");
          System.out.println("a==c is "+(a==c));
        } catch (Exception e) {
          e.printStackTrace();
    }Now, what's the correct way to evaluate equality of String objects in Java?
    HTH. Cheers. Keith.

  • Object creation performance

    hi, am new to java, i have a set of classes, each class has only static methods, no non static methods and no attributes, and i have one loader class which will receive 2 string parameters which are the class name needs to be instantiated and the method name needs to be called, as i read java has this option which about create/call - object/method at runtime using the reflection technique as follows :
    public void CallMethodByName(string objectName, string methodName)
          Class c = Class.forName(objectName);
          Method m = c.getDeclaredMethod(methodName, null);
          m.invoke(null, null);
    }but when i take a look at the "Factory Creation Pattern" ( [http://en.wikipedia.org/wiki/Factory_method_pattern|http://en.wikipedia.org/wiki/Factory_method_pattern] ) i can see that they are using switch statement for all type of objects that will be created, so i start to ask my self why didnt they mention to use such features in the programming languages like the reflection in java?? is it bcuz it is not an object oriented standard ?? or it has some performance defects?? so when i start to think that way i end up this solution:
    public class Loader
    public void CallMethodByName(string objectName, string methodName)
          if(objectName == "Class1")
                new Class1(methodName);
          else if(objectName == "Class2")
                new Class2(methodName);
          else if(objectName == "ClassN")
                new ClassN(methodName);
    class Class1
          public Class1(string method)
                 if(method == "method1")
                       method1();
                 else if(method == "method2")
                       method2();
                 else if(method == "methodN")
                       methodN();
          public static void methid1()
          public static void methid2()
          public static void methidN()
    }with this approach it well appears that the performance will not be good specially if the true condition was the last if condition, but if it is then how did they used it in the factory pattern ??
    i like to hear your suggestions with pos and cons for each approach and i'll happy to learn other new approaches, thnx.
    Edited by: akkadation on Nov 17, 2008 5:04 AM
    Edited by: akkadation on Nov 17, 2008 5:06 AM
    Edited by: akkadation on Nov 17, 2008 5:06 AM
    Edited by: akkadation on Nov 17, 2008 5:08 AM

    akkadation wrote:
    but when i take a look at the "Factory Creation Pattern" (http://en.wikipedia.org/wiki/Factory_method_pattern) i can see that they are using switch statement for all type of objects that will be created, so i start to ask my self why didnt they mention to use such features in the programming languages like the reflection in java??
    Probably because it does not belong there. Using Reflection would be an implementation detail that has nothing to do with the pattern in general.
    Also it's usually not that great an idea, because you force your paramters to be class names, which kind of defeats the entire abstraction done by the factory (i.e. if the caller already needs to know the class name, why doesn't he simply instanciate it directly?).
    is it bcuz it is not an object oriented standard ?? or it has some performance defects?? so when i start to think that way i end up this solution:Using reflection can be kind-of slow. It's gotten way faster with newer JDKs (especially in Java 5 and later), but it's still not as fast as other alternatives.
    [snip code]Don't use "==" to compare Strings!
    with this approach it well appears that the performance will not be good specially if the true condition was the last if condition, but if it is then how did they used it in the factory pattern ??"it well appears" is a pretty bad approach with performance. Test it, use some microbenchmarks to make sure. Guessing is far too easy to get wrong in that area.

  • While Loop - Object Creation

    Hello,
    I have a question on object creation and while loops. Have a look at the following code snippet:
    while(true)
           Object obj = new Object();
           // Pass off obj to a new thread
           Thread job = new Thread(new ObjectHandler(obj));
           job.start();
    }My question is, do I have to wait until the newly created Thread is finished with the Object obj before I can create a new Object called obj in the while loop?
    Also does anyone have any documentation on this sort of thing?
    Thanks,
    Tony.

    Jaxie wrote:
    I'm still not sure you get what I'm on about, you might want to read up on java methods and pass by value.I think we know how it works. Most of us have been programming in Java for serveral years.
    >
    When you pass an object to a method in java you pass it a copy of a reference to that object. Leading on from that, before an object is eligible for garbage collection in java, all references to that object must be dropped.
    So with all that in place, my question was, is the creation of an object in a while loop dependent on previous objects of the same name? Objects don't have names. Have we mentioned that before?
    You have a reference, larry that is referencing an unnamed object. You can also create other references that reference the same object. The thread will have one reference. You can then make larry reference another object. That will not change anything in the thread. It will still reference the old object, and that object will not be claimed by the gc until that thread stops referencing it.
    So the second time we go through the loop below, do we have to wait until larry has been garbage collected, before a new larry can be created?Read the articles/tutorials and what I have written above. What do you think?
    Do also note that the GC isn't executed synchronously.

  • Java Object Creation

    A general question about how can Java object creation with an average amount of data retrieval is considered as a reasonable.
    For example if I am clicking on a link in a web application...to paint that page, I think, about 4-5 java object with an average data retrieval of 20 rows wud be considered as appropriate. Any other thoghts or any other parameters to take into consideration?

    If you are concerned about object creation speed, you probably shouldn't. Even my laptop PC can create and garbage collect some 12 million objects per second (10,000,000 objects takes about 800 milliseconds). Test program below; remember to run with "java -server" to get the faster optimizing compiler. For laughs, write an equivalent C++ program that does new&delete in a similar loop.
    public class CreateObject
        public static void main(String args[])
         throws Exception
         for (int m = 0; m < 5; m++)
             doit();
        static void doit()
         long start = System.currentTimeMillis();
         for (int n = 0; n < 10 * 1000 * 1000; n++) {
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
         long end = System.currentTimeMillis();
         System.out.println((end - start) + " ms");
    }

  • Aborting new object creation

    I want to test the input parameters to a constructor and determine if an invalid parameter has been supplied.
    If I use:
    Thingy myThingy = new Thingy("invalid value");
    is it up to the programmer of the above to catch the error, either through exception handling or some other form of error checking, and perform
    myThingy = null;
    to render the partially initialized object ready for garbage collection?
    Is there a way in the constructor itself to indicate that the object shouldn't be created and null should be returned as the result of the "new" operation?
    Thanks,
    John

    But I'd say Clem1986 still has a point. Even in the constructor
      Foo() throws Exception {
        throw new Exception("Bollocks");
      }there's the implicit call to super() and instance initializers before you arrive at throw. From JVM spec: The new instruction does not completely create a new instance; instance creation is not completed until an instance initialization method has been invoked on the uninitialized instance. Which is done above. Whether this qualifies in OP's context as completing instance creation or instantiating an object I don't know. But you could work with it in the constructor, and once you get to throw, memory has been allocated, all superclasses have been initialized (which might involve heavy allocation/computation), default values were assigned to fields and instance initializers have executed. Only now can you decide to "abort new object creation" by completing abruptly and not "returning" the reference to the newly-(partially-)created object to the caller.

Maybe you are looking for

  • Send attachments from finder via Outlook 2011 for Mac

    I am trying to right click attachments in finder and choose send by mail. Unfortunately only mac mail comes up and I need to use outlook 2011. Its installed and chosen as default in both outlook settings and mail settings. Can drag attachments to out

  • Waiting in WDA

    Hello Friends, I am developing a WDA application wherein I need to perform and RFC call to check some information on other system. If that information is not yet updated on the remote system. I have to wait for sometime and then again call RFC. So th

  • Contact Photos in Mac OS

    On my Mac my Facebook Contacts are not updating their photos - I tried Enable Photo Updates in Preferences of the Contact App, but this did not work.  Any other Suggestions?

  • EREC: Duplicate selection options on job search screen

    Hello, I am getting duplicate selection options for unregistered job search. Functional Area, contract type, country are being displayed two times. I looke dup search templates, but didnt find any duplicate values. Help is much appreciated.

  • 5D Mark III Video Problem -- Help Needed!

    Hello, Been using my 5D Mark III for video for about a month now. I noticed a problem occurring in the middle of certain shots where the color seems to shift. The problem is so slight that it will take full screen, full HD and a high level of concent