Do I return an object within or outside a try block?

I am getting some strange errors/compile messages within a block of code that I introduced a try and catch. Before I used it, everything worked fine, example - this works:
public OracleConnection connect() throws Exception{
Connection con = ...create it here...
// I do not catch anything
return con;
Then I tried this:
public OracleConnection connect() throws Exception {
try{ Connection con = ...create it here...
} catch { (Exception e)};
return con;
here the compiler tells me: variable con not found in class. -but it is I just defined it in the try statement!
Then I tried:
public OracleConnection connect() throws Exception {
try{
Connection con = ...create it here...
return con;
} catch { (Exception e)};
and I get a compiler error saying the method doesn't return anything...
Whats the deal?
null

The Connection is only in scope inside the try because you declare it within the block.
As Fred says, declare the object outside the block, then set the value within the block. This way that value is available after the block.
Also, in the interests of good code, it is considered bad form to catch Exception when you know the exact exeption you are catching, so your code idealy would be:
public Connection connect() {
Connection con = null;
try{
con = DriverManager.getConnection(jdbcUrl);
// etc
// etc
catch (SQLException sqle) {
// Cope an SQL related problem
return con;
This way if the code that follows the connection creation causes an exception of a different type you do not treat it the same way as an SQL related problem.
I'll get off my high horse now ;-)
Regards,
Chris

Similar Messages

  • How can i reference a MIME object within a correspondence format through...

    how can i reference a MIME object within a correspondence format through TX oofo or se71?
    Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?   
    Regards    Hector

    Frank,
    I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
    Can you clarify the following ?
    1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
    The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
    What should I replace that EL expression with?
    2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
    public void initBusinessDataDashboardView() {
    OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
    Map params = operation.getParamsMap();
    Key panelKey = getPanelInfoView().getKey();
    params.put("panelKey", panelKey);
    params.put("maximizedView", false);
    panelView = (ViewObject)operation.execute();
    // Heck code to create CollectionModel
    RowSet rowSet = panelView.getRowSet();
    ArrayList rowList = new ArrayList();
    while (rowSet.hasNext()) {
    rowList.add(rowSet.next());
    model = new ChildPropertyTreeModel(rowList, null);
    // To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
    public CollectionModel getModel() {
    return model;
    Am I on the right track?
    Edited by: Pricilla on May 4, 2010 2:20 PM

  • XI calling an Oracle Stored Procedure which returns an Object to XI

    I am currently trying to call an Oracle Packaged/Procedure from XI which accepts a couple of parameters as I/O and returns an Object as one of the parameters.
    I have created the Object within the Oracle Database CREATE OR REPLACE TYPE xy_jdbc AS OBJECT
    column_name type ...etc
    CREATE OR REPLACE TYPE xy_tab_jdbc AS TABLE OF xy_jdbc;
    One of the parameters for the stored procedure is set up as this type xy_tab_jdbc this will be populated based upon one of the parameters passed into the  Package/Procedure.
    Is this possible? If it is, how do I map the returned object within XI?

    Dear Hilary,
    the JDBC adapter does not support vendor-specific or non-scalar data types.
    Workaround: Change the stored proc's signature not to use an object, but the object's fields instead.
    Regards,
    Thilo

  • How do I preview objects that are outside of artboard.

    Hello,
    When I placed an illustrator file in Indesign, I would select command+D > select "Show Import Options" and we have a preview of the image. On some occasions, the preview will include all extraneous objects that are outside of the artboard and other times, it will display only the image within the artboard or bounding box. (Please see attached samples)
    Does anyone know the reason behind this?
    Thanks,
    Sutagami

    The only way I can reproduce what you are experiencing is if I save out as an .eps and am not mindful of the Artboard check box on the save dialog. If you deselect this check box you will get all of the file content, if you select this check box you will only get the designated Artboard bounding area. But you never said what file format your are saving or what version of Illustrator you are using. I have to assume you are in CS4.

  • Returning Business Objects to View?

    All,
    I was just in a meeting where two different approaches to returning data to the view were discussed.
    In a nutshell, here are the two options presented:
    1) The service layer should return the Business Entities entirely (which happen to be Hibernate objects).
    2) The service layer should return an object thats specific to the process at hand and contains only the data needed for that process.
    We will have multiple clients invoking the service both remote, and local.
    My preference is to go with option 2.
    What are your thoughts?
    Thanks in advance,
    KL

    If you had not mentioned the words "Hibernate object", I would have been agnostic. However, IMO, these should be considered persistence tier objects. While there is a 'lazy-load view' pattern, there is also much discussion as to whether this is a good idea. For example, if I call a getter on a Hibernate object within the view, it may invoke a complex series of database operations to fetch a graph of dependent child objects.
    IMO, it is the responsibility of the controller to ensure that the view has all model data required to render properly.
    There is one further point to consider, only tangentially related to your original topic. Hibernate objects, generally, will correspond more strongly to the persistence scheme than the actual ideal OO model you might have designed separately. True, for the vast majority of model->persistence mappings, this will be 1 to 1. However, for the 20% of the system where this is not the case, you really do want to use a full-fledged model object.
    So, couple with what, to me, is dangerous--having a view implicitly lazy-load data--with the fact that a HIbernate 'object model' is really more of a 'table-model', I would advise against option #1.
    - Saish

  • Dragging to select multiple objects within a Pages document

    I am trying to select multiple, closely spaced objects (text boxes, lines, shapes, etc) within a Pages document. They are located ~1/3 of the way from the left margin of the document, and there are objects both to the left and the right of this group.
    I know that you can click outside of the Pages document with the mouse, then drag into the document to select multiple objects. However, is there any way to drag to select multiple objects without first clicking outside the document?
    Command click is a pain in the butt because I inevitably mis-click and have to start again to select all objects. I don't like having to drag in from the margin and then command-click to de-select objects I don't want.
    is there not an option to just shift-click to form a selection box around objects within the document? It seems like there should be a simple solution to this, but I have yet to find it.
    Thanks

    mattcass wrote:
    Command click is a pain in the butt
    Isn't it just! The people who created Pages should get a right spanking on this fundamental stuff up.
    All you can do is try again. I find myself repeating the same task over and over in Pages simply because you can't easily grab things.
    When you do +command click+ try and get the edges of objects, otherwise Pages thinks you are still trying to click inside the object.
    Once you have +command drag lassoed+ multiple objects you can +shift command click+ to unselect the ones you don't want. Again a problem if they are close to each other.
    Peter

  • Problems returning complex objects from a php data service

    either the data services tool is buggy or i am doing something wrong. here is the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/halo"
         minWidth="1024" minHeight="768"
         xmlns:personservice="services.personservice.*"
         initialize="init()">
         <fx:Script>
              <![CDATA[
                   import mx.rpc.events.ResultEvent;
                   import mx.controls.Alert;
                   import mx.collections.ArrayCollection;
                   public var people:ArrayCollection;
                   private function init():void {
                        getPeopleInMyWorldResult.token = personService.getPeopleInMyWorld();
                   protected function getPeopleInMyWorldResult_resultHandler(event:ResultEvent):void {
                        people = new ArrayCollection(event.result as Array);
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getPeopleInMyWorldResult" result="getPeopleInMyWorldResult_resultHandler(event)"/>
              <personservice:PersonService id="personService"
                   destination="PersonService"
                   endpoint="http://localhost/photoapp/Test3-debug/gateway.php"
                   fault="Alert.show(event.fault.faultString)"
                   showBusyCursor="true"
                   source="PersonService"/>
         </fx:Declarations>
    </s:Application>
    <?php
    class Person {
         public $name;
         public $cars;
    class Car {
         public $year;
         public $make;
         public $model;
    class PersonService {
         public function getPeopleInMyWorld() {
              $person1 = new Person();
              $person1->name = "John Doe";
              $car1 = new Car();
              $car1->year = 2005;
              $car1->make = 'audi';
              $car1->model = 'A6 Quattro';
              $car2 = new Car();
              $car2->year = 1970;
              $car2->make = 'datsun';
              $car2->model = '510';
              $person1->cars = array($car1, $car2);
              $person2 = new Person();
              $person2->name = "Jane Doe";
              return array($person1, $person2);
    create a new "flex" project in FB Beta1 with a php server. Setup the application and php script as normal, then configure the return type for the getPeopleInMyWorld function. I created a new return type called "Person" and was quite please to see that FB automagically created a "Cars" class with the all the right properties.
    Unfortunately, if you run the code (try debug mode and put a breakpoint on the result handler) you'll notice that "john doe" has lost his cars and that you also get the silent (check console) error:
    TypeError: Error #1034: Type Coercion failed: cannot convert []@1226bc49 to mx.collections.ArrayCollection.
    any ideas??
    i can get this to work by using json, but it's extra work, the com.adobe.serializers.json.JSONDecoder has little documentation, and the method outlined above is just begging to work.
    so, how are the rest of you getting complex data back from your servers? json?? amfphp?? xml (but surely not)??
    also, since i'm here discussing data services, if any adobe ppl are about, please throw one extra voice behind the following feature requests:
    1) support for optional service call arguments (http://bugs.adobe.com/jira/browse/FB-19659)
    2) a button for automatically 'generating service calls' from within the data services panel.
    thanks,
    - e

    Thank you Gaurav for pointing me in the right direction. There was some debate in the blogs as to which data transferring method (amfphp, json, or xml) was best. See
    http://blogs.adobe.com/mikepotter/2006/07/php_and_flex_js.html
    and
    http://www.5etdemi.com/blog/archives/2006/12/clearing-the-fud-on-amfphps-speed-versus-json -and-xml/
    I used json yesterday
    php:  json_encode(array($p1, $p2));   // observation: you only have to encode once as opposed
                                          // to using amf on each array...
    FB:   private var jsonD:JSONDecoder = new JSONDecoder();
          var jsonString:String = {{{return result from service call}}}
          myPeople:ArrayCollection = jsonD.decode(jsonString, services.personservice.Person);
    Note that in FB you can use the services.personservice.Person class as an optional argument in the jsonD.decode function. This class can be automatically generated using FB's built-in data service's panel when you try to configure the return type (as I described above). The json data should unserialize correctly with Cars objects automagically created and everything (a huge time saver!!).
    It worked for me, though I'm not sure how deep the unserialization process is capable of going (objects within objects w/in objects, for example). Also I had some trouble with adobe's jsonDecoder; it had trouble eating (uhm parsing) hollow objects (i.e. objects with null properties), whereas the php_encode / php_decode handled these objects w/o fail.
    Anyway, will be reading up on amf. Tanx again Gaurav,
    - e

  • Unable to click on excel object within a word 2010 document

    Whenever a user tries to click an Excel Object within a Word 2010 document, the error "Microsoft Word can't start the application required to open this object. An error occured and this feature  is no longer functioning properly. Would you
    like to repair this feature now?". Clicking YES runs a repair on Office 2010, which does not resolve the issue. Clicking No gets you the following prompt: "The program used to create this object is Excel. That program is either not installed on your
    computer or it is not responding. To edit this object, install Excel or ensure that any dialog boxes in Excel are closed." 
    Operating System: Windows 7, Office Version: 2010
    I've tried the following to resolve the issue, without success:
    Running the Office Repair as suggested in the prompt
    There are no open dialog boxes in Excel
    There are no COM add-ins or Excel add-ins active in Excel
    Starting Word in Safe Mode (clicking CTRL on open) does not resolve the issue.
    "Ignore other applications that use Dynamic Data Exchange (DDE)" is unchecked in Excel.
    I am able to edit this document with no problem on a machine running Windows 7 with Office 2007 or even office 2013.

    Hi,
    Do you see this problem if you start Windows in Safe Mode? You might want to have a try and verify result, some outside application may be preventing the OLE server/client connection.
    Have you ever checked your anti virus? Try to disable it and check again.
    Please make sure to install any updates to your system or Office products. It's important to make it up to date.
    Try to go to your task manager to kill any excel process and then try again.
    I have seen a case that user finally fixed this with a clean uninstallation and reinstallation, if issue presists with all above steps, you might want to do a completely reinstallation and then try again.
    Thanks,

  • Returning an object that contains a collection WL 9.2

    Hello,
    I have a class like this:
    public class data {
    private Collection<MyObject> coll; //MyObject is another class
    If I return this object from a web service call, i.e.
    @WebService
    public class HelloWorld {
         @WebMethod
    public data hello() {
    I get an error saying java class MyObject is not known, which makes sense, because I only declared "HelloWorld" to jwsc task.
    How can I make this class known, by annotation etc.?
    Someone suggested to use "IncludeSchema" in the jwsc task, but apparently that has been deprecated.
    Thanks!
    Edited by ghosh007 at 02/21/2008 12:59 PM
    Edited by ghosh007 at 02/21/2008 1:23 PM

    Hi,
    As you have this "Artiicle" class, extend it to be serializable and then define an Array of type Artiicle. So the return type would be an Array of a complex type i.e. Articles. In WSDL there will be type that defines an Array and this type can be used as a return message for your methode.
    Try this, I think it will help you.
    Regards,

  • SharePoint Foundation Sandboxed Code Service - Unable to activate worker process proxy object within the worker process

    Issue:
    On a vanilla installation, the sandboxed code service (e.g. SPUCHostService.exe) is started; however, SPUCWorkerProcessProxy.exe and subsequently SPUCWorkerProcess.exe fails to start.
    Resolution/Workarounds attempted:
    Attempted 2 different Load balancing settings – local and remote (i.e. affinity)
    Ensured local computer policy on server for ‘RPC Endpoint Mapper Client Authentication’ and ‘Restrictions for Unauthenticated RPC clients’ is disabled.
    Ensured following key in registry is set properly - HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\RPC
    Attempted to bypass SharePoint’s check for certificate revocations at crl.microsoft.com
    Ensured the service account is added to the respective groups (e.g. Performance Log Users, Performance Monitor Users, IIS_IUSRS, WSS_ADMIN_WPG, WSS_WPG)
    Increased limit of ‘AbnormalProcessTerminationCount’ of SPUserCodeService via Powershell
    We have tried all possible workarounds from the following MSDN reference:
    http://blogs.msdn.com/b/sharepointdev/archive/2011/02/08/error-the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request.aspx
    ULS:
    02/21/2014 05:24:50.64  SPUCHostService.exe (0x0230)  0x0F74  SharePoint Foundation Sandboxed Code Service              fe8a               
    Medium               -  - Unable to activate worker process proxy object within the worker process: ipc://38432b45-2f32-4926-ade2-ef53ae1cd501:7000  
    02/21/2014 05:24:50.64  SPUCHostService.exe (0x0230)  0x0F74  SharePoint Foundation Sandboxed Code Service              fe8c               
    Medium               -  - Error activating the worker process manager instance within the worker process. - Inner Exception: System.InvalidOperationException: Unable to activate worker
    process proxy object within the worker process: ipc://38432b45-2f32-4926-ade2-ef53ae1cd501:7000     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies()    
    02/21/2014 05:24:50.64  SPUCHostService.exe (0x0230)  0x0F74  SharePoint Foundation Sandboxed Code Service              ei0t               
    Medium               - Process creation/initialization threw an exception. Stopping this process. "ipc://38432b45-2f32-4926-ade2-ef53ae1cd501:7000"
    02/21/2014 05:24:50.65  SPUCHostService.exe (0x0230)  0x0F74  SharePoint Foundation Sandboxed Code Service             
    fe87                Medium               -  - Error activating the worker process manager instance within
    the worker process. - Starting worker process threw - Inner Exception: System.InvalidOperationException: Unable to activate worker process proxy object within the worker process: ipc://38432b45-2f32-4926-ade2-ef53ae1cd501:7000     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies()   
    Any other insights on how I can troubleshoot the issue described?
    Thanks in advance!

    Hi ,
    For resolving your issue , you can do as the followings:
    1. Logged into the Web Server with the Timer Service Account.
    2. Ran the powershell command to check the SID of the account running the spucworkerprocessproxy.exe:  
    $(Get-SPManagedAccount -Identity "THE SERVICE ACCOUNT").Sid.Value
    3. Checked the registry :
    HKEY_USERS\[SID OF THE SERVICE ACCOUNT]\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing\State
    4. Changed the value 0x00023c00 to 0x00023e00
    In addition, here are some similar posts for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/aae497df-5f0d-4f86-a724-c7b805ccd07f/sharepoint-sandboxed-code-service-troubles?forum=sharepointgeneralprevious
    http://blogs.technet.com/b/operationsguy/archive/2011/01/17/sharepoint-2010-sandboxed-code-solutions-and-web-proxy.aspx
    http://social.msdn.microsoft.com/Forums/en-US/c21e2c3a-a259-4d5f-8071-eff52b7bddc3/issue-sandbox-solution-too-busy-to-handle-the-request?forum=sharepointgeneralprevious
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Returning an Object Array

    I am unable to figure out the way in which I can return an object
    array from a cpp file to java. Is there any obvious error which you can spot in
    my CPP file?
    When I try to return a single object in the native function,
    it works fine but when I try to extend it and return an array of the object, it
    throws an error.
    Please find below the details
    h1. Java Class
    public class Flight {
    public String ID;
    public class InterfaceClass {
    private native Flight[] GetFlights();
    public static void main(String[] args)
    Flight[] objFlight = new
    InterfaceClass().GetFlights();
    System.+out+.println(objFlight[0].ID);
    static {
    System.+loadLibrary+("main");
    h1. CPP File
    JNIEXPORT jobjectArray JNICALL Java_InterfaceClass_GetFlights(JNIEnv env, jobject obj)
    //1. ACCESSING THE FLIGHT CLASS
    jclass cls_Flight = env->FindClass("LFlight;");
    //2. CONSTRUCTOR FOR FLIGHT CLASS
    jmethodID mid_Flight = env->GetMethodID(cls_Flight,"<init>", "()V");
    //3. CREATING AN OBJECT OF THE FLIGHT CLASS
    jobject objFlight = env->NewObject(cls_Flight, mid_Flight);
    //4. ACCESSING THE FLIGHT's "ID" FIELD
    jfieldID fid_ID = env->GetFieldID(cls_Flight, "ID","Ljava/lang/String;");
    //5. SETTING THE VALUE TO THE FLIGHT's "ID" FIELD
    env->SetObjectField(objFlight,fid_ID, env->NewStringUTF("ABC"));
    //6. ACCESSING THE FLIGHT ARRAY CLASS
    jclass cls_Flight_Array = env->FindClass("[LFlight;");
    if(cls_Flight_Array == NULL)
    printf("Error-1");
    //7. CREATING A NEW FLIGHT ARRAY OF SIZE 1 jobjectArray arrFlightArray = env->NewObjectArray(1,cls_Flight_Array,NULL);
    if(arrFlightArray == NULL)
    printf("Error-2");
    //8. INSERTING A FLIGHT BJECT TO THE ARRAY
    env->SetObjectArrayElement(arrFlightArray,0,objFlight);
    return arrFlightArray;
    h1. Error
    # A fatal error has been detected by the Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION
    (0xc0000005) at pc=0x6d9068d8, pid=1804, tid=3836
    # JRE version: 6.0_18-b07
    # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing
    windows-x86
    # Problematic frame:
    # V [jvm.dll+0x1068d8]
    # An error report file with more information is saved as:
    # C:\Users\Amrish\Workspace\JNI Test\bin\hs_err_pid1804.log
    # If you would like to submit a bug report, please visit:
    http://java.sun.com/webapps/bugreport/crash.jsp
    C:\Users\Amrish\Workspace\JNI Test\bin>java -Djava.library.path=.
    InterfaceClass
    Exception in thread "main" java.lang.ArrayStoreException
    at
    InterfaceClass.GetFlights(Native Method)
    at
    InterfaceClass.main(InterfaceClass.java:6)
    C:\Users\Amrish\Workspace\JNI Test\bin>java -Djava.library.path=.
    InterfaceClass
    Exception in thread "main" java.lang.ArrayStoreException
    at
    InterfaceClass.GetFlights(Native Method)
    at
    InterfaceClass.main(InterfaceClass.java:6)
    Edited by: amrish_deep on Mar 18, 2010 7:40 PM
    Edited by: amrish_deep on Mar 18, 2010 7:40 PM

    //6. ACCESSING THE FLIGHT ARRAY CLASS
    jclass cls_Flight_Array = env->FindClass("[LFlight;");The argument to NewObjectArray is the +element+ class of the array you're about to create, not the +array+ class itself.

  • SRM system object within Portal: WAS settings with Webdispatcher

    Hello Portal experts,
    we have SAP EHP4 ERP system (only ABAP stack).
    In order to use some SRM functionality we installed SAP EP (EHP1) and creates a appropriate system object within portal.
    We use a  Webdispatcher, so we have to replace within WAS area the local address by the address of Webdispatcher and appropriated port (webserver:567).
    The tests of this system object looks as follows:
    The address of http://webserver:567 can be retrieved
    The problem are the results of following tests:
    http://webserver:567/sap/bc/ping
    http://webserver:567/sap/bc/webdynpro
    These errors occured because the both pathes /sap/bc/ping and /sap/bc/webdynpro do not exist on Portal/Java engine.
    Questions:
    How can we connect ABAP backend to Portal with extra Webdispatcher?
    What are the setting within WAS area?
    kind regards

    Hi Thom,
    Is your webdispatcher in front of your portal? or in front of the ICM of your Backend System?
    If the applications that you want to enable via your EP are of the type: WD for ABAP, BSP, IAC or ITS then you should also have a webdispatcher in front of your Backend System (in addition to on in front of your portal).
    Please check the following link:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/9a9a6b48c673e8e10000000a42189b/frameset.htm
    On this page, scroll down to the last example. Although the image is there to explain "High Availability of the SAP Web Dispatcher" it gives you a good view on the request respond steps.
    One rule of thumb is that the EP system itself doesn't act as a reverse-proxy. In other words, if an iView points to a WD 4 ABAP application on the Backend then the actual WD4ABAP application is rendered in an iFrame.
    From a technical/connection point of view the client (browser) has 2 connections, one to the EP and 1 tot the Backend.
    Allot of people do not realize this when they start there project...
    Cheers, hope this helps you a bit....
    B

  • How to create multiple objects within a class

    I have a item.lvclass which has an item.ctl (contains a cluster of class private data).  I need to add another object (item2.ctl) within that same class so that I can reuse the code for that class.
    So how do you create additional objects within the same class?

    Well... right now...  I've cornered myself going down this path:  http://forums.ni.com/t5/LabVIEW-Idea-Exchange/LVOO​P-Interfaces/idc-p/1314637#M8918
    Seems like the solution in the idea was not implemented yet....
    Okay.  I will try to describe the situation differently...
    Let's say I have a Car.lvclass
    I want to have two objects:  sedan & roadster
    both have similar properties, but also have different properties:
    4 doors vs 2 doors
    hardtop vs convertible
    silver vs white (color)
    I want the two objects to be of the same class so that they can share the same private and public VI's.  As a matter of fact, I want to have both objects in the VI's within the Car.lvclass.

  • When a Method Returns an Object, does it return a copy or a pointer?

    When you have a method that returns an Object, is the Object returning a copy of the Object returned inside
    of the Method or is it an Actual pointer to the Object inside of the method's coresponding Object?
    so say you have an object ...
    Class Something {
    JLabel myLabel = new JLable("myLabel");
    public JLabel getLabel() {
    return myLabel;;
    Something something = new Something();
    JLable theLabel = something.getLabel()
    theLable.setString("theLable");
    so when I setString on the Object theLabel , am I going to change the value of myLabel inside of the Object something?

    Yes, it returns a pointer.

  • Calling a method that returns an object Array

    Hello.
    During a JNICALL , I wish to call a method which returns an object array.
    ie my java class has a method of the form
    public MyObject[] getSomeObjects(String aString){
    MyObject[] theObjects=new MyObject[10];
    return theObjects
    Is there an equivalent to (env)->CallObjectMethod(...
    which returns a jobjectArray instead of a jobject, and if not could somebody suggest a way around this.
    Thanks,
    Neil

    I believe an array oj jobjects is also a jobject. You can then cast it to another class.

Maybe you are looking for