Any idea why super() and this() needs to be first statement

Java recommends super() and this() to be the first statement to be used.why this design constraint is imposed?
This imposes one more restriction
where super() and this() cannot be used at the same time?
how this constraint is useful.
for eg:
class A
     A(int a)
     System.out.println("A(int)");
     A(int a,int b)
     System.out.println("A(int,int)");
class B extends A
     B()
          super(1);
          System.out.println("B()");
     B(int i)
          this();
          super(1,1);//compile-error :must be first statement
the above eg may be a bad design,but are the constraints imposed for this purpose?or anything else?

To make sure that the constructor is the first thing that runs, and to make sure >the super instance is completely constructed before we do anything with the >child instance.
Both these go toward having the object be in a consistent, valid state.I accept the point,but considering the code part
B()
   //super(1);
System.out.println("B()");
B(int i)
super(1,1);
this();
}in above super instance will be constructed first followed by this().
but this() cannot be used as second statement???
I feel ,this is because this() in turn calls the super constructor again?to restrict this constraint made?is it something like that?

Similar Messages

  • While creating a project in Garage Band my sample tracks were cut short then overwritten in soundtrack pro. Any ideas why? and how to get my tracks back?

    While creating a project in Garage Band 09 my sample tracks were being cut short- I then discovered they had been overwritten in soundtrack pro.
    Any ideas why? and how to get my tracks back?
    I never opened soundtrack pro to edit the track just Garage band....the track just mysteriously saved as half the track.
    I am running Lion and I upgraded my Garage band to '11 hoping it would resolve the issue...it didn't. Now I can't find that tracks at all.
    The 2 songs having the issue are titled Exotic Yearning and Reunion.
    I am in the process of reinstalling the audio content from my discs. I just don't want to run into this again.
    Any thoughts and help would be greatly appreciated!
    Thanks!

    After spending some time reinstalling the soundtrack pro 3 content I opened the full track called Reunion.
    It showed back up in Garage Band.*It was the full track and wasn't chopped off until I dragged it onto the project. Then it showed up chopped.
    Then I closed Garaged band and opened soundtrack pro 3....The song was again chopped off at the 1:33min mark
    Very Frusterated...:(

  • Any idea why i get this panic message and have to shut down?

    Interval Since Last Panic Report:  371517 sec
    Panics Since Last Report:          7
    Anonymous UUID:                    C15F8CC1-AD3D-4B74-B527-EE4BC559D8DB
    Wed Jun 20 14:03:19 2012
    panic(cpu 0 caller 0x226ec0): "thread_invoke: preemption_level -1, possible cause: unlocking an unlocked mutex or spinlock"@/SourceCache/xnu/xnu-1504.15.3/osfmk/kern/sched_prim.c:1471
    Backtrace (CPU 0), Frame : Return Address (4 potential args on stack)
    0x35eb3d38 : 0x21b837 (0x5dd7fc 0x35eb3d6c 0x223ce1 0x0)
    0x35eb3d88 : 0x226ec0 (0x593ab8 0xffffffff 0x593a50 0x226790)
    0x35eb3e08 : 0x2275c6 (0x55b67c4 0x55b67c4 0x35eb3e68 0x233203)
    0x35eb3e78 : 0x227654 (0x0 0x0 0x0 0x0)
    0x35eb3e98 : 0x221d42 (0x0 0x0 0x0 0x322384)
    0x35eb3eb8 : 0x490daa (0x5249170 0x0 0x54ea194 0x0)
    0x35eb3f28 : 0x49149d (0x0 0x0 0x0 0x5249170)
    0x35eb3f68 : 0x32255c (0x54ea194 0x5249170 0x0 0x54ea1ac)
    0x35eb3fc8 : 0x2a179c (0x54ea184 0x0 0x2a17ab 0x4b87124)
    BSD process name corresponding to current thread: kernel_task
    Mac OS version:
    10K549
    Kernel version:
    Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
    System model name: MacBookAir1,1 (Mac-F42C8CC8)
    System uptime in nanoseconds: 543706395621
    unloaded kexts:
    com.apple.iokit.IOAHCIFamily    2.0.6 (addr 0xd68000, size 0x24576) - last unloaded 115654996660
    loaded kexts:
    com.cisco.nke.ipsec    2.0.1
    com.apple.filesystems.smbfs    1.6.7 - last loaded 45582341552
    com.apple.filesystems.msdosfs    1.6.3
    com.apple.filesystems.autofs    2.1.0
    com.apple.driver.ApplePlatformEnabler    2.0.2d1
    com.apple.driver.AppleHDA    2.0.5f14
    com.apple.driver.AudioAUUC    1.57
    com.apple.driver.IOBluetoothBNEPDriver    2.4.5f3
    com.apple.Dont_Steal_Mac_OS_X    7.0.0
    com.apple.driver.AudioIPCDriver    1.1.6
    com.apple.driver.AppleHWSensor    1.9.3d0
    com.apple.driver.SMCMotionSensor    3.0.1d2
    com.apple.driver.AppleUpstreamUserClient    3.5.7
    com.apple.driver.AppleMCCSControl    1.0.20
    com.apple.driver.AppleIntelMeromProfile    19
    com.apple.driver.ACPI_SMC_PlatformPlugin    4.7.0a1
    com.apple.driver.AppleLPC    1.5.1
    com.apple.driver.AppleBacklight    170.0.46
    com.apple.kext.AppleSMCLMU    1.5.2d10
    com.apple.driver.AppleIntelGMAX3100    6.3.6
    com.apple.driver.AppleIntelGMAX3100FB    6.3.6
    com.apple.driver.AppleUSBTCButtons    201.6
    com.apple.driver.AppleUSBTCKeyboard    201.6
    com.apple.driver.AppleIRController    303.8
    com.apple.driver.AppleUSBEthernet    2.1.39
    com.apple.BootCache    31.1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib    1.0.0d1
    com.apple.driver.AirPortBrcm43224    428.42.4
    com.apple.driver.AppleUSBHub    4.2.4
    com.apple.driver.AppleEFINVRAM    1.4.0
    com.apple.driver.AppleSmartBatteryManager    160.0.0
    com.apple.driver.AppleIntelPIIXATA    2.5.1
    com.apple.driver.AppleUSBEHCI    4.2.4
    com.apple.driver.AppleUSBUHCI    4.2.0
    com.apple.driver.AppleRTC    1.3.1
    com.apple.driver.AppleHPET    1.5
    com.apple.driver.AppleACPIButtons    1.3.6
    com.apple.driver.AppleSMBIOS    1.7
    com.apple.driver.AppleACPIEC    1.3.6
    com.apple.driver.AppleAPIC    1.4
    com.apple.driver.AppleIntelCPUPowerManagementClient    142.6.0
    com.apple.security.sandbox    1
    com.apple.security.quarantine    0
    com.apple.nke.applicationfirewall    2.1.14
    com.apple.driver.AppleIntelCPUPowerManagement    142.6.0
    com.apple.driver.DspFuncLib    2.0.5f14
    com.apple.driver.AppleProfileReadCounterAction    17
    com.apple.driver.AppleProfileTimestampAction    10
    com.apple.driver.AppleProfileThreadInfoAction    14
    com.apple.driver.AppleProfileRegisterStateAction    10
    com.apple.driver.AppleProfileKEventAction    10
    com.apple.driver.AppleProfileCallstackAction    20
    com.apple.iokit.IOSurface    74.2
    com.apple.iokit.IOBluetoothSerialManager    2.4.5f3
    com.apple.iokit.IOSerialFamily    10.0.3
    com.apple.iokit.IOAudioFamily    1.8.3fc2
    com.apple.kext.OSvKernDSPLib    1.3
    com.apple.driver.AppleHDAController    2.0.5f14
    com.apple.iokit.IOHDAFamily    2.0.5f14
    com.apple.iokit.AppleProfileFamily    41
    com.apple.driver.IOPlatformPluginFamily    4.7.0a1
    com.apple.driver.AppleBacklightExpert    1.0.1
    com.apple.iokit.IONDRVSupport    2.2.1
    com.apple.driver.AppleSMC    3.1.0d5
    com.apple.iokit.IOGraphicsFamily    2.2.1
    com.apple.driver.AppleUSBMultitouch    207.7
    com.apple.driver.BroadcomUSBBluetoothHCIController    2.4.5f3
    com.apple.driver.AppleUSBBluetoothHCIController    2.4.5f3
    com.apple.iokit.IOBluetoothFamily    2.4.5f3
    com.apple.iokit.IOSCSIBlockCommandsDevice    2.6.8
    com.apple.iokit.IOUSBHIDDriver    4.2.0
    com.apple.iokit.IOUSBMassStorageClass    2.6.7
    com.apple.iokit.IOSCSIArchitectureModelFamily    2.6.8
    com.apple.driver.AppleUSBMergeNub    4.2.4
    com.apple.driver.AppleUSBComposite    3.9.0
    com.apple.driver.XsanFilter    402.1
    com.apple.iokit.IOATABlockStorage    2.6.0
    com.apple.iokit.IO80211Family    320.1
    com.apple.iokit.IONetworkingFamily    1.10
    com.apple.iokit.IOUSBUserClient    4.2.4
    com.apple.iokit.IOATAFamily    2.5.1
    com.apple.iokit.IOUSBFamily    4.2.4
    com.apple.driver.AppleEFIRuntime    1.4.0
    com.apple.iokit.IOHIDFamily    1.6.6
    com.apple.iokit.IOSMBusFamily    1.1
    com.apple.kext.AppleMatch    1.0.0d1
    com.apple.security.TMSafetyNet    6
    com.apple.driver.DiskImages    289.1
    com.apple.iokit.IOStorageFamily    1.6.3
    com.apple.driver.AppleACPIPlatform    1.3.6
    com.apple.iokit.IOPCIFamily    2.6.5
    com.apple.iokit.IOACPIFamily    1.3.0
    Model: MacBookAir1,1, BootROM MBA11.00BB.B03, 2 processors, Intel Core 2 Duo, 1.8 GHz, 2 GB, SMC 1.23f20
    Graphics: Intel GMA X3100, GMA X3100, Built-In, 144 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8B), Broadcom BCM43xx 1.0 (5.10.131.42.4)
    Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial ports
    Network Service: USB Ethernet, Ethernet, en4
    Network Service: AirPort, AirPort, en0
    Parallel ATA Device: MCCOE64GEMPP, 55.9 GB
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8505, 0xfd400000 / 3
    USB Device: USB2.0 Hub, 0x05e3  (Genesys Logic, Inc.), 0x0608, 0xfd100000 / 2
    USB Device: Apple USB Ethernet Adapter, 0x05ac  (Apple Inc.), 0x1402, 0xfd130000 / 7
    USB Device: Samsung G2 Portable, 0x04e8  (Samsung Electronics Co., Ltd.), 0x6033, 0xfd110000 / 6
    USB Device: Officejet 7200 series, 0x03f0  (Hewlett Packard), 0x4111, 0xfd140000 / 5
    USB Device: HP Wireless Comfort Desktop, 0x0461  (Primax Electronics), 0x4d5a, 0xfd120000 / 4
    USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x1d200000 / 2
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x8210, 0x1d210000 / 5
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0224, 0x5d200000 / 3
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0x5d100000 / 2

    Uninstall the Cisco VPN client according to the developer's instructions and see whether there's any improvement. Use the built-in Cisco client instead, if possible.

  • Any idea why I receive this error msg?

         I am only attempting to download my Camera Roll to my Mac for further editing and have been unable to due to these errors!
    1. "Photos folder syncing has been disabled for the iPhone “John's iPhone” because the folder “Camera Uploads” cannot be found.
    2. "iTunes cannot Sync photos to the iPhone because the folder "Camera Uploads" cannot be found".
         The above error msgs appear  when attempting to sync via the iTunes app! So I tried to download my photos via Image Capture app and it shows that the
    iPhone has "No Photos"? Next I trie via iPhoto with same results, "No Photos"?
         Of course all this has happened since the install of IOS 7 yesterday, so that may be a hint! Any suggestions would be appreciated, as always!

    Uninstall the Cisco VPN client according to the developer's instructions and see whether there's any improvement. Use the built-in Cisco client instead, if possible.

  • Sometimes after putting my iMac to sleep, I can't get it to wake up and have to turn it off at the mains. Any ideas why?

    Sometimes after putting my iMac to sleep, I cannot get it to wake up again. It's as if it's shut down and I have to turn it off at the mains and restart it.  Any ideas why? Does this keep happening to anybody else?

    That message means that you have to restore the iPad now. Something went wrong. You need to restore the iOS software and then restore from the backup.
    Read this carefully and follow the instructions. Make sure that you restore from your backup at the end of the process. That is covered at the bottom of the support article.
    http://support.apple.com/kb/HT1414

  • I download OSX mountain Lion and my mac is very slow.Any idea why?

    After downloading mountain lion my mac gets slow...any idea why?

    Try this:
    Boot into Safe Mode then reboot normally. Do the following:
    Repair the Hard Drive and Permissions - Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Does this help? If not, then you should reinstall Mountain Lion:
    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • My ipad was taking really clear photos but now they are blurry and grainy.  Any ideas why?

    My ipad was taking really clear photos but now they are blurry and grainy.  Any ideas why?

    Try This...
    Close All Open Apps...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Can anyone explain what the other section section in the HDD usage description is for ? I recently used iphoto to send a mail and this "other "section inrease the usage by about 1GB....any ideas why ?

    Can anyone explain what the "other" (yellow colour) section in the HDD usage description is for and what it does.It is under the about this mac section and storage option?
    I recently used iphoto to send mail with photos attached and this "other" section increased by about 1GB. The mail size was around 900KB.....any ideas ?

    Shurig wrote:
    Thanks gor replying,,,this is my first time on this site.
    Any idea why the "other" continues to increase. I have just got got my mac so no new apps installed yet only been using it for mail and web browsing. I tried the iphoto mail last night and noticed the the "other" section had increased by 1GB which I thought was rather larger. Do you know what this setion actually does ?
    Also do you know if it is possible to delete the iphoto emails.
    All of your 'stuff' that is not Music Movies Apps Backups or Photos is in Other, that means all your emails, all your files etc, why don't you just leave well enough alone, this is not windows and doesn't need tinkering with,

  • I just upgraded my software to OS X 10.9.2 (13C64) and i can no longer use my printer (epsun stylus sx235w).  any ideas why this would happen?

    i just upgraded my software to OS X 10.9.2 (13C64) and i can no longer use my printer (epsun stylus sx235w).  any ideas why this would happen?

    Mavericks is the name of your operating system. It is otherwise known as OSX 10.9.
    The previous versions were indeed "cat things".
    The way you would know if you need to download new software from Epson is to go the Epson website and search for your printer there, look for downloads, and see if they have new software listed for 10.9.
    You can revert your system back to what it was two weeks ago. This would be easier to do if you have a backup that you made prior to installing Mavericks (like with Time Machine). If you don't have a backup (sounds like you probably don't), you can look here for some directions about how to go back to the "Cat Thing" that you had prior to installing Mavericks: How to revert OS X back from Mavericks: Apple Support Communities
    If all of this is too hard for you, you could take your Mac in to your Apple store and ask them to help you.

  • Changes that i make to song display in iTunes, will not carry over when I sync to my ipad. This is only since i upgraded to ios7 and downloaded the latest itunes. Any ideas why?

    I use my iPad for music when i teach my dance class. The default layout in the music program on iPad is: song title, artist and album. I need the name of the dance, so in iTunes, I right click on the song title, then choose "get Info".  I then edit the info and under album title I write in the dance name. Then when i sync the iPad still has the same three columns, but the info i need displays under the album column.  UNTIL i upgraded to ios7 and installed the latest iTunes.  When I synced last night, after adding new music, the songs that were already in the playlist, stayed the same. ALL the new songs were placed in the playlist but none of the info that i edited synced.  It shows it as i want it when i look at the playlist in iTunes, but it does not carry over after the sync. 
    I hope this makes sense and does anyone have any idea why?

    Amazing! I'm a dance instructor and am doing the exact same thing as you - and not seeing what I need on my iPad Air ... I can't believe there has been no reply on this! I also can't believe there isn't an easy way of seeing track info in the iPad or iPhone but I've spent hours searching and am not finding anything

  • I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why?

    I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why? I saw a thread saying to purchase the newest software (that was posted a few years ago) I paid 4.95 for the software and it's still saying it can't be updated.  Am I just SOL??

    The 1G iPod can only go as high as 3.1.3. The 1G does not have an internal speaker or volume buttons on the upper left edge.
    Identifying iPod models
    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.

  • I cannot access any songs on my iPod classic. I had around 20,000 songs on it and it now says I have 12,00o but can't access them. Any idea why this has happened?

    I cannot plug it into iTunes and reload as my MacBook crashed a few days ago and I had to get a new hard drive. Recovery software is unable to retrieve anything from the hard drive.
    All the songs were from CDs so not saved in iTunes.
    The iPod was last plugged into the MacBook one day before it crashed and it was Ok when I ejected it.
    Could it be anything to do with this? Doesn't an iPod have its own memory? Any ideas why it has happened and if their is anyway of retrieving it? Is it best to just take it into an apple shop? I am no longer covered with apple support.
    Thanks.

    When I hover over cover flow it says I have 12851 songs but when I click nothing happens.
    When I hover over artists or albums it says 'no artists/albums'.
    I can upload again from my CDs but just wondering if there is anything to do. I live abroad so all my CDs are in storage.

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • When trying to upload a cd onto itunes it chooses to chop the original cd into 4 separate albums and mix up the track order. Any ideas why and how to overcome this problem?  ( the cd is guy gerber and called fabric 64)

    When uploading a cd onto itunes on my imac it has choosen to copy the original cd into 4 seperate cds and mix up the track order, particularly annoying as this is a mixed cd (Guy Gerber, fabric 64) .  Any ideas why when everthing else copies perfectly and how to rectify this problem?

    See Grouping tracks into albums.
    tt2

  • My daughters iPhone is frozen with the apple showing on the screen.  We have turned it on and off but it is still stuck on that screen.  Any ideas why or how to correct this?

    My daughters iphone4 is frozen to a blank screen with the apple on it.  We have turned it on and off and it still remains on this screen.  We cannot access gef phone at all.  Any idea why this is happening or how to correct?

    connect it to the computer/itunes you normally do.

Maybe you are looking for

  • Is there any way to enable "list view" in Yosemite's Calendar app (like you could in previous versions)?

    In pervious version of OS X, the Calendar app showed a "list view" while in the "day" view. Here's an example. Any way to enable this or did Apple kill this helpful feature?

  • Printing 2 notifications in 1 page

    Hi All, I need to print two notifications in one page. One notification will only printed at half the page while the 2nd notification will be printed on the other half page. Lets say if I selected multiple print job (eg 100 notification) , and 50 pag

  • Why is creation of a service notification using BAPI not working?

    I need to create a service notification. I have found 2 BAPIs. BAPI_SERVICENOTIFICAT_CREATE BAPI_SERVNOT_CREATE The code below using the second BAPI is not creating a notification and the return parm does not have any errors. You can see it does a ca

  • Flash player youtube problem

    Ok guys, this one is a bit more complicated than it sounds. A while back I was using a older version of Fox, I think v 15.xxx and had flash player 11 or 12. When using youtube it looked great. But now I upgraded to the latest firefox and latest flash

  • Compatexport.cpp line 33 error

    upgraded to 6.1 and I am getting the error compatexport.cpp line 33. I have installed MS visual C++ but I am not sure how to fix the problem.... and I have tried...