Trying to use this() in a constructor, not the first line

I'm currently re-writing some old code of mine that was used to create a neural network. My main contructor, originally, was
public Network(int sizeLayer1, int sizeLayer2, int sizeLayer3) Now, however, I've decided that I want to make my network a little more general, and allow any number of layers. Therefore, my revised basic constructor is
public Network(int[] sizeLayers)which expects an array of ints corresponding to the size of each layer.
However, I've got some old programs that use the old contructor which I can't change (and anyway, it's good to have the option to be able to use both). I therefore want to create a constructor that has the same signature as the old one, but simply places the values in an array and passes the array to the new constructor.
public Network(int sizeLayer1, int sizeLayer2, int sizeLayer3) {
  int[] sizeLayers = {sizeLayer1, sizeLayer2, sizeLayer3};
  this(sizeLayers);
}obviously won't work, because 'this' must be the first line of the constructor. How can I put my values in an array and call the new constructor?
Thanks!

Silly me -- I had been trying to do
this({sizeLayer1, sizeLayer2, sizeLayer3});but of course that wouldn't work.
Thank you very much for that reply!
However, more generally, what if I wanted to do a few lines of processing on the variables passed, like adding them together before calling this()? Is there no way to do that? What's the purpose of requiring that this() be the first line in the constructor?
Thanks!

Similar Messages

  • Error when trying to use this query in report region

    Hi ,
    I am getting "1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00933: SQL command not properly ended"
    while trying to use this query in reports region .
    Pls help.
    Thanks ,
    Madhuri
    declare
    x varchar2(32000);
    begin
    x := q'!select (first_name||' '|| last_name)a ,
    count(distinct(session_id)),manager_name
    from cappap_log,
    MIS_CDR_HR_EMPLOYEES_MV
    where DECODE(instr(upper(userid),'@ORACLE.COM',1),0,upper(userid)||'@ORACLE.COM',upper(userid)) = upper(email_address)!';
    if :P1_ALL = 'N' then
    x:= x||q'!and initcap(first_name ||' '|| last_name)=:P1_USERNAME!';
    else
    x:= x||q'!and initcap(first_name ||' '|| last_name)like '%'|| :P1_USERNAME||'%'!';
    end if;
    if :P1_APP_NAME = '%' then
    x:= x||q'! and flow_id like '%'!';
    else
    x:= x||'flow_id = :P1_APP_NAME';
    end if;
    x:= x||q'! group by first_name||' '|| last_name , manager_name!';
    return x;
    end;

    Hi, I am actually stuck here. Can you please let me know which among these is the higher version.
    1) Final Release 3.50
       Version 3500.3.016
    2) Final Release 3.50
        Version (Revision 481)
    Because it is working fine in the 1st one whereas its throwing that error pop-up in 2nd one(as soon as we select the Change query global definition option) .

  • When trying to use my banking apps I get the error "Network Required  This application requires an active Internet Connection.  Please try again"

    When trying to use my banking apps I get the error "Network Required  This application requires an active Internet Connection.  Please try again".  This happens with two different apps from two different banks.  One of them works occasionally and have not figured out why.  I have cell signal and I am on a strong WiFi network.  Same thing happens when I turn off the WiFi too.    I have tried uninstalling and re-installing the app with no improvement.   I can't seem to find any setting that would cause this.   Does anyone have any suggestions?  

    I can access the internet just fine in the browser and i can use any other app i have.
    Sent from my Verizon Wireless 4G LTE DROID

  • Iphoto will not open my iPhoto library......have tried everything.  This has only happened in the last week.

    Iphoto will not open my iPhoto library......have tried everything.  This has only happened in the last week.
    I have tried everthing suggested on the forum.

    Did you follow these directions?
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.>Click on the Add Library button,
    2 -  select the library you want to add from those in the selection window.
    3 - make sure that in the rebuild window the checkbox  "Scavange orphaned photos" is checked.
    4 - now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option
    5 - in the next  window name the new library and select the location you want it to be placed. Click on the Create button.
    Note 1: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost.
    Note 2:  Your current library will be left untouched for further attempts at a fix if so desired.

  • Using verizon890l-213e and when trying to use mapquest app ipad5 will not track

    Using. Verizon 890l-213e and when trying to use mapquest app ipad5 will not track on the map

    Try to plug it into itunes and click 'restore'. After the restore is complete, set the ipad up as a new one, NOT as a backup. This way it can install new software. Let me know if that works.

  • I have an apple ID, I'm trying to use this to update and download apps etc. however, whenever I try this, it keeps asking me to use my old ID, which is attached to an email that no longer exists! I can't download or update anything! Help!

    I have an apple ID, I'm trying to use this to update and download apps etc. however, whenever I try this, it keeps asking me to use my old ID, which is attached to an email that no longer exists! I can't download or update anything! Help!

    You can log out of the currently logged in account by taping on the id in Settings > Store (Settings > iTunes & App Stores on iOS 6) and you can then log back in.
    If you updated your existing account with a new email address then that shoud 'refresh' it on it
    If you created a new account then any content that you purchased/downloaded via the old account will remain tied to that old account, and only that old account can redownload its content and download updates to its apps. You should be able to update an account's email address via this page : http://appleid.apple.com

  • The filtering process could not be initialized when trying to process this item. Verify that the file extension is a known type and the item is not corrupt

    I am getting below error message while search crawl in sharepoint foundation 2010 search for only .VSD files and not for any other docs type.
    The filtering process could not be initialized when trying to process this item. Verify that the file extension is a known type and the item is not corrupt. 
    I have installed the Microsoft Filter Pack 2.0 in search server but still i am getting the same error.
    <//span>
    Any one's help will be appreciated.
    Regards,
    Rashmi
    Rashmi Singhal

    Hi Rashmi,
    1. Checked the file extension is added or not to the search file types.
    2. Checked file name has any invalid characters.
    3. Resetting the crawl index and run a full crawl .
    Best Regards.
    Kelly Chen
    TechNet Community Support

  • Is it possible to put the photos on my iPhone 5 onto my MacBook Pro? The photos that I am trying to do this with we're not taken from the phone. They were imported from a computer.

    Is it possible to put the photos on my iPhone 5 onto my MacBook Pro? The photos that I am trying to do this with we're not taken from the phone. They were imported from a computer. When I open image capture it only shows the photos that were taken from my phone and not the other ones. Please help. Thanks.

    It is not possible to put synched photos on your iPhone from one computer into another.

  • How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.

    How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.  i really just want my money back.  Very disappointed.  Also disappointed that it is so hard to find a way to communicate with Adobe that I have to resort to asking this question in this forum. 

    You need to use the CHAT link in support to reach Adobe staff. Be sure you know the product name you are trying to cancel, Adobe have lots of products, several converters etc. I think it is ExportPDF you have, most likely.

  • The most recent update erased all of my bookmarks. I tried the steps to find them and they are gone. This is not the first time this has happened and it extremely disuptive.

    the most recent update resulted in a loss of ALL of my bookmarks. This is not the first time this has happened and it is very disruptive. I tried the steps suggested to find the bookmarks but that failed.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • When trying to use viber a) viber icons in the contacts do not appear b) when trying to call other viber users receive notification that users have to download viber first c) when other viber users try to contact they are notified the my vers. needs updat

    When trying to use viber a) viber icons in the contacts do not appear b) when trying to call other viber users receive notification that users have to download viber first c) when other viber users try to contact they are notified the my vers. needs updat

    A brief and probably non-helpful answer: I know of no way to eliminate your large amount of duplicates other than by repetitive, tedious manual effort.
    *There has got to be a simpler way.*
    I hope you're right, but I don't think there is a simpler way.
    BACKUP:  It also appears that the only way I can back up the catalog is to shut down LR.  Really?!
    Yes, really

  • Sometime ago I found a copy of Photoshop 5.5 (both the APPLICATION and TRAINING) CD's in trash. I finally am getting around to try to use this, but I do not have a serial number. I have the original CD's, not illegal copies - how can I get serial numbers

    Sometime ago I found a copy of Photoshop 5.5 (both the APPLICATION and TRAINING) CD's in trash. I finally am getting around to try to use this, but I do not have a serial number. I have the original CD's, not illegal copies - how can I get serial numbers to use to get this program working?

    Sorry to say you are out of luck.
    The serial numbers came on the cd case. If they are no longer there, you have no way of using the program except as a 30 day trial. Adobe does not sell CS5 licenses any more.
    Gene

  • HT3529 I'm having trouble with my iPhone 5 iMessage service. The device does not recognize the users who have iMessage when I try to contact them using this feature. Who have the same issue and what did you do in order to solve it?

    I'm having trouble with my iPhone 5 iMessage service. The device does not recognize the users who have iMessage when I try to contact them using this feature. Who have the same issue and what did you do in order to solve it?

    Read here:
    http://support.apple.com/kb/ts2755

  • I bought this very nice iMac. The first time I ever use a Apple product. Can someone please tell me where the delete key is on the keyboard. I cannot think for one moment that Apple did not provide for such a key. Please help.

    I bought this very nice iMac. The first time I ever use a Apple product. Can someone please tell me where the delete key is on the keyboard. I cannot think for one moment that Apple did not provide for such a key. Please help.

    The delete key does a backward delete because it is the natural way to delete while typing. May not be to you and the millions of youngsters who grew up with windows computers. When you are typing and want to delete that which you just typed you are already at the end and you delete back to where you want to re-type. When you go back to a document and want to delete a selection, you have to go to the end of the selection instead of the beginning. it's just the way its always been done on macs. it takes some getting use to.
    If you select text to be deleted with your mouse then the delete key deletes the selected text. same for either delete key method.
    It is not convenient when you tab to fields in a form. That why fn-delete does a forward delete.
    Macs have a couple of keyboards. The small "wireless keyboard" only has the (backward) delete (fn-delete forward). The larger "Apple Keyboard with Numeric Keypad" has both a Delete (backwards) key beside the = abd it has the "delete >" key in the groups with fn, home, end, Pg up and Pg dn. This keyboard is best for users who have switched from windows or are familiar with the windows forward delete.

  • After updating itunes to the latest version it will now not open. I have tried reinstalling the programme, rebooting and all other suggestions, to no avail. this not the first time I have had issues with itunes. Frankly I find it completely unacceptable .

    I recently updated itunes to the latest version and now the programme will not open.
    I have tried all suggestions such as reinstalling the programme, rebooting you name it, nothing.
    This most frustrating and completely unacceptable, especially when a company such as Apple touts itself being the leader in music technology yet does not respond directly to questions about faults in their system, but prefers to leave to disgruntled customers to try and sort it out amongst themselves
    This not the first time I have had frustrating problems with the Apple system. Perhaps someone could suggest a more reliable system to switch to. Someone with a better troubleshooting system.

    Going all the way back to Firefox 3.0.5 is shear foolishness, it is 14 security versions behind the last 3.0.19 release. And that version is missing at least a dozen security updates that were applied to the 3.5 and 3.6 versions after support for 3.0.x ended.
    If you are not happy with Firefox 4, you should have installed Firefox 3.6.17. That is very similar to the 3.0 and has all the security fixes that have been released since support for Firefox 3.0.x ended last year.

Maybe you are looking for

  • Xml parsing error while selecting whole result set for sql query

    Hi All, I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows. My exception is below. ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00234: names

  • Purchase Requistion : Overall Release Problem

    Hi everybody, Have a peculiar problem where Item Level release seems to be working fine. And the first time we want to use release at header level and its not working. The OverReqRel (overall requisition release) is 'checked' [at release group level]

  • Question for the new List component

    hello I work with Oracle BI Publisher 11.1.1.5 anf firefox 3.6.17 I have a problem with the new component LIST. i open the report SFO Passenger Count Report in the samples/11G overview/ I choose the tab named insight tab i select Air china in the Air

  • HT4275 Can I use a different batteries than the apple ones 1900 mAh, like 2500 mAh which are the usually sold in stores?

    Can I use a different batteries than the apple ones 1900 mAh, like 2500 mAh which are usually sold at any store?

  • 2LIS_04_P_MATNR

    Hi all,        Does the Production business content (Appl 4) 2LIS_04_P_MATNR capture the Planned order number even if the production cycle is not completed? We are able to get the Planned order number from the business content only when the Productio