Why the two objects are not add by java

like below
Integer i1=new Integer(5);
Integer i2=new Integer(5);
System.out.println(i1+i2);
if i run this program out put is 10
but
Object o1=new Object();
Object o2=new Object();
System.out.println(o1+o2);
gives compilation error.
plz help me to solve this doubt

Assuming this is not an April Fools Day joke,
then the serious answer is: what does it MEAN to add two arbitrary objects?
Intuitive answer:
If all you told Java is that o1 is an Object and o2 is an Object,
how would Java know what to do with them?
Are them numbers? Are they lists? Are they graphical icons? What?
Technical answer:
The + operator requires numbers or Strings.
And Java's auto-unboxing only works for primitive types.
So only String, Float, Double, Integer, Short... will work.
Object will not work.

Similar Messages

  • Why the distant objects are not shown ?

    Hi , everyone .
    The distant objects are not shown unless moving the view closer to them in Java3D .
    How to change or set to show the distant objects without moving the view ?
    Anyone on any information or advice would be helpful.
    3QS !!!
    PS: using the defualt virtual universe : SimpleUniverse

    When you are creating the View Object do something like this:
    // Set up the Front Clipping Distance - in Virtual Eye Coordinates
    myView.setFrontClipPolicy( View.VIRTUAL_EYE );
    myView.setFrontClipDistance( FRONT_CLIP_DISTANCE );
    // Set up the Back Clipping Distance - In Virtual Eye Coordinates
    myView.setBackClipPolicy( View.VIRTUAL_EYE );
    myView.setBackClipDistance( BACK_CLIP_DISTANCE );
    The VIRTUAL_EYE can be replaced by PHYSICAL_EYE and a few others(check javadocs for View for more info)
    and the FRONT_CLIP_DISTANCE and BACK_CLIP_DISTANCE are just :
    public static final double FRONT_CLIP_DISTANCE = 0.1; // 0.1 Virtual Meters
    public static final double BACK_CLIP_DISTANCE = 100; // 100 Virtual Meters
    so to get your objects in the distance to render at a greater distance from them, then just increase the BACK_CLIP_DISTANCE to 1000 or something like that
    NOTE: the larger the BACK_CLIP_DISTANCE, the longer and slower it will take to render you scene each frame. YOU WILL PAY FOR THIS (in CPU time)
    Hope this helps
    -- Rob

  • I have Lion and I have an iPad.  The contacts on the two machines are not properly linked using iCloud (I can create groups and add names, but sometimes the names are not updated between the machines)

    The problem I am seeing is that there are contacts on the iPad that are not showing up on the Mac

    On the iPad, look in contacts and see if you have more than one group.  If it says "all contacts" on the top and there is no red slash to chose lists, then you have just one group.  If you see the slash and can choose contact groups, then obviously you have more than one.  You probably have a mail account on the iPad setup for contacts and iCloud also setup for contacts.
    Go to that mail account on your computer and export those contacts to a vCard file, and import that to iCloud contacts (using the web interface for each).  Now with one list, turn contacts off for that account on your iPad so you don't see duplicates.

  • HT5213 I have two books published to the iBookstore via Blurb. Unfortunately, they just used my first name on the second book. It is like it is by a different author to the first book. -The two books are not linked. Is there anyway I can edit the author's

    Hello. I have just joined this community and would be grateful for advice on editing my name submitted to the iBookstore by Blurb on one of my books. I would like to have both of my books with the same author's name. Is it possible? Thank you.

    Thank you, Tom. I did contact Blurb support back in March and was told the following:
    "We are not able to change the specifications of how Apple Itunes show the author's name on their site.
    Apple always have strict specifications of how they set up the Ebook on their site.
    This issue can only be solved by contacting Apply and they will not change the name of the site".
    I didn't know how or where to contact Apple at that time and gave up. I am resurrecting the issue now as I have seen I have sold some books and would like the people who bought them to learn of my other book.
    I am grateful to both Blurb and Apple for making my books possible, but I would like to fix this issue. I will contact Blurb again.
    Thanks for your support.

  • [SOLVED]Why the partition numbers are not in sequence?

    Hi guys!
    Here is an extreme newbie Q...
    I want to install Arch linux...
    I have windows 8 64-bit installed on the HDD with MBR partition table...
    And here are my partitions (in order) that I see from the arch usb installation media:
    /dev/sda1: System Reserved (primary, active)
    /dev/sda2: C (primary)
    /dev/sda3: Extended
        /dev/sda5: D (Logical)
        /dev/sda6: E (Logical)
    Uallocated space.
    So I already have 2 primary and 1 extended partition.
    Now, my question is: Why did it skipped the number sda4?
    Is it normal?
    When I create third primary partition on unallocated space, it assigns the number sda4 to it...
    What is going on?
    Last edited by Sameer (2013-09-24 11:34:57)

    donniezazen wrote:It is normal. You could use GPT to get over restriction of 4 primary partitions and have them orderly numbered.
    This is true; however, Windows will boot from a GPT disk only on an EFI-based system. If the computer in question supports EFI, you can make that switch, as described here, or you can re-install Windows. If the computer is strictly BIOS-based (as are most that are older than about 2 or 2.5 years), you're pretty much stuck with MBR if you're booting Windows from the disk. Overall, it's probably better to just stick with MBR partitioning.
    FWIW, Linux doesn't need to reside on a primary partition. Given the setup described by Sameer, my recommendation would actually be to use GParted to expand the size of the extended partition (/dev/sda3) to cover the whole disk, and then create logical partitions for Linux. This way you won't use up all of the primary partitions, which might prove to be important in the future, should you need another primary for some reason. It can also keep the partition numbers increasing, albeit with a jump from 3 to 5.

  • HT4859 My two iPhones are not sync'd identically from the iCloud ...  Why?

    My two iPhones are not syncing identically from the iCloud .... Anybody know why?

    What isn't the same?

  • "There was a problem connecting to the server.   URLs with the type "file:" are not supported.  Why?  What can be done to eliminate it?

    After upgrading to Mountain Lion, I repeatedly get this message:  "There was a problem connecting to the server.   URLs with the type "file:" are not supported. 
    Why? 
    What can be done to eliminate it?

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • Why is the FORM OBJECT selection not found in the Preferences/Accessibility selection?

    Hello,
    I am using the Dreamweaver cs6. I was wondering why the FORM OBJECT selection is not found in the Preferences/Accessibility selection?

    The engineers removed it.  Why?  That's anybody's guess.  You'll have to add them manually.  Please refer to the HTML5 forms workflow video below:
    http://tv.adobe.com/watch/learn-dreamweaver-cc/html5-forms-workflow/
    Nancy O.

  • TS3989 When I try to add photos from PhotoStream into my iPhoto Library a message appears asking to view the photo in the library (as if it were already imported).  When I click View it brings me to my iPhoto library but the photo(s) are not there?

    Hopefully someone can help me with my question.  When I try to add photos from PhotoStream into my iPhoto Library a message appears asking to view the photo in the library (as if it were already imported).  When I click View it brings me to my iPhoto library but the photo(s) are not there?

    When I try to add photos from PhotoStream into my iPhoto Library a message appears asking to view the photo in the library (as if it were already imported).
    How exacly are you trying to import from the Photo Stream? Dragging from the stream to the events? Ctrl-clicking or right clicking?
    If "Show in Library" does not show the event, then your iPhoto Library may need repairing or rebuilding;  try to run the iPhoto Library First Aid Tools, if you have not already done so. See this post by Old Toad on how to do it:    Rebuild iPhoto Library Version 11:
    Regards
    Léonie

  • Why my old emails are not showing on the blackberry

    Hi Guys,
    I have just bought Blackberry Curve 9360. Can somebody, please tell that why my old emails are not showing on the blackberry. May be it has not synchronized my whole mailbox.
    Kindly advise how can I do that.
    Regards... Murtaza

    Old emails, in what manner? As in previous to installing the account on this device?
    Did you use the Device Switch Wizard found in the BlackBerry Desktop Software?
    How did you move your old emails over from the old device to the new?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • IPod updates 2 touch with the new software, and from the update they are not connected with Time phase. They appear calling but never they enter the calls. I make calls with other users and if one connects but in these two not from the update

    iPod updates 2 touch with the new software, and from the update they are not connected with Time phase. They appear calling but never they enter the calls. I make calls with other users and if one connects but in these two not from the update

    I use Firefox 95% of the time, and there's no problem with flash content (and I'm still at .55 - downloaded .64 last week but I haven't got round to making the change yet). At the rate they've been changing it recently it may well be out of date already .
    I've been trying it in Safari, too with no problems apart from You Tube, but that's because I'm blocking Google cookies.
    One thought does occur - if your Flash preferences are set to block all Local Storage, it may be that the problem site is trying to use Flash cookies (LSOs). I had this problem recently with the BBC iPlayer streaming content. Little Snitch notified an attempt to connect to a new URL - emp.bbci.co.uk.
    If I disallowed it, no streaming; when I allowed the connection, it still wouldn't stream, so I did a bit of digging and came to the conclusion that it was trying to set a Flash cookie. When I unblocked, lo and behold - streaming resumed as normal.
    I now have LSOs blocked in a more subtle way that lets the site think it's being set (but it ain't) and the streaming still works.
    As for permissions repair - always repair from local; the permissions on the original disc will have been superceded by updates and new installations of Apple software.
    DU needs to be reading the packages on the HD, not the (now out of date) install disc.
    The recurring repair messages are normal and don't mean anything's wrong. As long as the final message is 'repair complete' there's no need to dwell on it.
    http://support.apple.com/kb/TS1448 (for Leopard and Snow Leopard - Lion no doubt has it's own set).

  • Why are the application in the apple store are not compatible with the iPod touch 4g? Apple please realize there are some of us who still have the iPod touch 4g!

    Why are the application in the apple store are not compatible with the iPod touch 4g? Apple please realize there are some of us who still have the iPod touch 4g! I just want to know.

    Once I find the game i will truly screenshot that it states "not compatible for these models". I just find it RIDICULOUS that my iPod touch is in good condition and some of the applications that I want download sometimes are not compatible with my iPod touch 4g. I am not going to buy an ipod 5th generation if my 4g is still going strong since the year of 2010.

  • Why the 3 little icons on the upright corner are not in color, just wondering

    Does anyone knows why the 3 little icons on the upleft corner in the aperture window are not in color ?
    i'm just wondering.

    That is by design.

  • I upgraded my ipad 2 to ios8 now also the iwork and the ilfe apps are not free why???

    i upgraded my ipad 2 to ios8 now also the iwork and the ilfe apps are not free why???

    The offer of free apps is tied not only to the version of iOS, but the purchase date of the device: Free Apple apps for your iPhone, iPad, and iPod touch with iOS 8

  • I bought the season 7 pass for Doctor Who, but the new episodes are not showing up for download.  Who can I contact to find out why?

    I bought the season 7 pass for Doctore Who, but the new episodes are not showing up for download.  I've been all over the support page, I even looked up my purchase history and there is are none showing and I even bought last weeks episode, The Bell's of St. John.   Who can I contact to find out why I'm not getting the rest of season 7 for download?
    Thanks,
    ChristyQ

    Garmin is sending you to Apple because it is Apple that would have to give you a refund as the actual point of sale.  However, Apple states all sales are final.
    Apple is sending you to Garmin because it is Garmin's fault their maps are out of date and Apple doesn't write the software.  They may not even be looking that deeply and simply perceiving it as a programming "bug" it is up to Garmin to solve.
    Who know whose fault it is that Garmin isn't getting up to date data to put in their maps.
    Ultimately I think you stand the best chance in getting a refund from Apple though it isn't guaranteed.  Apple is the cashier.  You just have to convince them this isn't just a line of code omitted from an application and isn't something that will be soon corrected by Garmin.  Make it clear it isn't a problem with the application running on your device, it is a problem with the data it contains.  Either that or you have to hope Garmin will feel so bad about it they will delve down into their slush fund and send you a refund.

Maybe you are looking for

  • Integrating Web JetAdmin with SharePoint

    Good afternoon from the East Coast (USA). Is there a way to have on a sharepoint site the HP Web JetAdmin console?

  • ASE  service Syabase SQLServer_"SID" don't start

    Hi, We have shutdown the ASE Server, after that we tried to start it insuccefully. with the msg "The Sybase SQLServer_"SID" service on "host" started and then stopeped.Somme services stop automatically are no in use by other services or programs" We

  • Multiline containers

    what is multiline container in work flow. why should we use multiline container.please explain with scenario

  • Steps to deploy Wireless application to 10G application Server

    Dear, I have a simple application developed using XForms/XHtml/JSP using JDeveloper Wireless Extension. I have been able to test the application in embedded OC4J in JDeveloper but I want to deploy this application in 10G application Server installed

  • How to reference background image url from css?

    Hello, I have uploaded some images and css files to the "Shared Components > Images". How can I reference my images as "background-image:url('XXX.gif')" for a css element? Thanks, John