I want a delete operator in Java. Why not?

The idea is simple: when I tell "delete some_object;" the system checks if the object can be deleted.
a) Object is not referenced by any other objects out of the reference cycle *=>* some_object object calls its destructor and then it is deleted, and the same should happen to all objects in the reference cycle. The reference some_object is set to null, as operator delete returns null.
b) Object is referenced by some other objects, which are not in a cycle of references, ending up at the some_object object itself *=>* some_object object is not deleted (destructor is not called), but the reference some_object is set to null (operator delete returns null) and the reference count of the some_object object (in the system) is decreased by 1.
Easy.
Why not?

grinice wrote:
b) Object is referenced by some other objects, which are not in a cycle of references, ending up at the some_object object itself *=>* some_object object is not deleted (destructor is not called), but the reference some_object is set to null Makes no sense. There can be multiple references to a given object, and you don't always own all of them. If you want to set one to null, you can already do that with ref = null;
Easy.If it's that easy, create your own language that does it.
Why not?Why?

Similar Messages

  • I want to delete my mobile me account not just from my iPhone but from existence. I want to delete it so that no emails can be received to it, and the sender would receive an undeliverable message. Is this possible?

    I want to delete my mobile me account not just from my iPhone but from existence. I want to delete it so that no emails can be received to it, and the sender would receive an undeliverable message. Is this possible?

    No, you can stop using the account, but you cannot delete it.

  • HT4928 what if i wanted to delete one of my purchases not just hide it?

    what if i wanted to delete one of my purchases not just hide it can i do that?

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    No, Apple will always maintain the fact that you bought the app in your purchase history. You can't not have bought it.

  • [Solved] Want to delete Opera 10 icon from menu

    I am currently using xfce4 and had installed Opera 10 beta a while back. I deleted it but I can not remove the Opera icon from the main application/network menu.
    Any idea to remove this icon?
    Thank you.
    -2501
    Last edited by 2501 (2009-06-24 04:06:57)

    If Opera or some other application decides to recreate it, there's another way that may work better. Edit the opera.desktop file in any text editor and set the line 'NoDisplay' to 'true'. If it doesn't exist, just add 'NoDisplay=true' on any new line in the file.

  • Want to delete mails from Thunderbird but not from the server?

    Hi,
    Please tell me how to configure the settings of Thunderbird so that if i delete any mail from Thunderbird that mail would be delete only from Thunderbird not from server. I'm using IMAP configuration for all my mail accounts and I'm using Thunderbird in my laptop and tablet both.
    Currently i'm using Thunderbird 24.4.0 and i just want to delete my useless mails from Thunderbird but not from the server without using pop-3 settings.
    Actually the reason for this Question arises because whenever i use to uninstall and reinstatement Thunderbird, i use to take "profiles" as a back up and its size is increasing day by day that is making a big issue to me as i cant take a back up of such a big size file.

    Imap mail accounts keep the emails on the server and you see a remote view of those emails and folders.
    When you subscribe to see a folder, the headers are downloaded, when you select an email to read, the entire folder is downloaded to a temp cache facilitating quicker access. If you synchronize folders, then a copy of that folder is downloaded to an mbox file in your profile, so that you have a copy of the server folder. When you make any changes to a synchronized folder, read an email, delete or move etc, then Thunderbird will resynchronize with the server to update the server. A synchronized folder allows you to work in 'offline' mode and this is the best time to perform a backup as you know there is a temporary stop on synchronizing as you are offline. They will resynchronize when you go back into 'online' mode.
    So, with IMAP mail accounts, the folders you see in Thunderbird are the same folders on the webmail server. If you make any changes via Thunderbird or webmail then you are changing the same folder. You cannot delete an email without deleting it from the server, they are one and the same.
    What you can do is move/copy an email into Local Folders and delete the one on the server. The Local Folders emails are kept in your Profile on your computer, these folders/emails are not on the server, unless you chose to keep a copy of them on the server.
    Pop mail accounts cannot see the folders on the server. They only access the server Inbox folder and download emails not previously downloaded to the mail account Inbox in Thunderbird. These emails are kept on your computer in your profile folder. You can select to keep a copy on the server or not. You can choose to delete emails off your computer and off the server or not.
    If the mail account is gmail , have you subscribed or even synchronized to see the 'All Mail' folder ? Gmail's all Mail folder is their Archive folder, it keeps a copy of all of your non-deleted emails. So, you do not need to subscribe to see this folder as it only shows you what you can already see in other folders. It doubles the disc space.
    Please read section on 'All Mail' at this link.
    * http://kb.mozillazine.org/Using_Gmail_with_Thunderbird_and_Mozilla_Suite
    You do not have to download/synchronize the entire folder. You could select to only synchronize the most recent xx days of emails.
    see info here:
    * https://support.mozilla.org/en-US/kb/imap-synchronization#w_configuring-synchronization-and-disk-space-usage

  • How can i keep music on my iPad with out my laptop wanting to delete it. my laptop does not have the music that os on my iPad and i dont want to lose it but i would like to add my laptops music to my ipad

    hi, i was jsut wondering how i can keep music on my ipad without itunes wantting to delete it i dont have the music that is on my ipad on my laptop and i would like to keep it on my ipad. but i would also like to add my laptops music to it. can you help me?
    my music on my ipad is not all from itunes.

    Open itunes, connect iphone,select what you want, sync

  • Firefox page is scrambled. Want to delete and uninstall but will not uninstall

    Print on firefox page is scrambled. Went to control, add/delete and tried to delete, but nothing happens--will not delete.

    Hello, the second option, double click the installer for Firefox 20 that you saved in your PC, install it, then you should be all ok and updated.
    thank you

  • Want to delete all iCloud files but not close accout

    I uploaded many items when I first created my iCloud account, but now realize I only want certain items there.  How do I delete all my iCloud data without canceling my iCoud account so I can start over?

    Simply delete all your contacts from address book, calendars from iCal etc etc, anything you remove from one device will be removed from the iCloud and all other devices.

  • A destructor and a delete operator

    Hello,
    How to use the delete operator in JAVA?
    Also what is the syntax of writting destructor?
    class sample
    LinkedList Lists;
    sample()
    Lists = new LinkedList();
    ~sample()
    delete Lists;
    The above code doesn't work in JAVA.
    May I know the reason?

    You may want to null a reference in this case:
    class X {
        private BufferedImage image;
        public void setImage(URL url) throws IOException {
            image = null;
            image = ImageIO.read(url);
    }Without nulling the image reference, the JVM may find it's out of memory and gc while reading the new image.
    It may even find it has to expand memory to hold the new image.
    It may only realize the old image is eligable for collection after doing this and updating the image
    reference. (A smart JVM may realize that the last reference to the old image is about to disappear
    and hurry it along, but you can imagine situations where the detachment is more subtle.)
    Again there are a few instances where nulling a reference makes sense.

  • I added music to a project in iMovies. I wanted to delete the music I put in,but could not figure out how to delete the music. I also had two songs playing at same time. How do I delete music from project in iMovies?

    I added music to a project in iMovies. I wanted to delete the music,but could not figure out how. I also had two songs playing at same time. How do I delete music in project and how do I prevent two song playing at same time?

    Select your Music Track so that a yellow border is around it. Then hit the Delete Key. Alternatively, hit EDIT/DELETE SELECTION.

  • This did not help me at all. I wanted to delete my purchased list. Delete. It is taking up to much of my space. It should be up to each person if they want to delete this off their ipad. Why should everyone be punished for this.

    I want to delete my purchase list and apple is saying you can't. Why? It should be up to each person, if they want to put something back on there they will have to repay. Why do we all have to be punished for this. I am not the only one that would like to have this deleted. It is taking up to much space on my I pad. I am not happy at all about this.

    What did not help you?
    You cannot delete apps from the purchase list nor can you delete the purchased list. That list is NOT taking up space on your iPad. It is just a list of the apps that you have purchased over time.
    If you want to HIDE the purchases so that you do not have to see them, you can do that in iTunes on your computer. You can read about it here.
    http://support.apple.com/kb/HT4919

  • I have over 300 pictures on my phone...my question to someone iphone savvy is why, when I plug my phone into the computer is iPhoto showing no pictures?  I want to delete them for space issues.  Thanks

    I have over 300 pictures on my phone...my question to someone iphone savvy is why, when I plug my phone into the computer is iPhoto showing no pictures?  I want to delete them for space issues.  Thanks

    I've seen this happen when the phone was encrypted... Other than calling apple/deleting passcodes I don't know of any solution.
    If you're keen on waiting, upload your photos to dropbox, that's the way I do it.

  • Why not have the concept of pointer,operator overloading  in java

    May you find a solution on why not have the concept of pointer,opterator overloading,virtual function and destructor in java

    Why oh why oh why oh why oh why oh why oh why oh why
    oh why oh why oh why oh why oh why oh why oh why oh
    why oh why oh why oh why oh why oh why oh why oh why
    oh why oh why oh why oh why oh why oh why oh why oh
    why oh why oh why oh why oh why oh why oh why oh why
    oh why oh why oh why oh why oh why oh why oh why oh
    why oh why oh why oh why oh why oh why oh why oh why
    oh why oh why oh why oh why oh why oh why oh why oh
    why oh why oh why oh why oh why oh why oh why oh why
    oh why oh why oh why oh why oh why oh why oh why oh
    why oh why oh why oh why oh why oh why does Java not
    have power steering??
    Please explain conceptIn the 2012 model year, Java will be redesigned with Power Steering, Electronic Stability Control, and integrated Blue Tooth.
    For the OP, just learn C/C++ and then you can have all the fun you want with pointers.

  • Why when i want to sync my phone with the computer it wants to delete all my apps how do i not let this happen. this is a different computer to the 1 i always use. i have authorised this computer but still wants to delete my apps

    why when i want to sync my phone with the computer it wants to delete all my apps how do i not let this happen. this is a different computer to the 1 i always use. i have authorised this computer but still wants to delete my apps

    Why you can't redownload? Don't you have the Apple ID that used to download these apps?
    You can "transfer purchaces" by right click on your iphone in iTunes but i guess you computer is not authorized and will ask you to authorize with Apple ID. Try it.

  • I want to know why I can't clear my history because whenever I open the view history menu, it goes to the library/bookmark menu. Essentially I just want to delete the websites that come up when I start to type in the url box

    I want to delete the websites that come up when I type in something in the URL box. I also want to be able to clear my history. I cannot do this because whenever I want to view the history it takes me to the book marks menu

    The Library handles both the History and the Bookmarks.
    Don't you see the History item in the left pane that shows the full tree ?
    See http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox

Maybe you are looking for

  • Missing features in OS2 Email client

    There are two glaringly missing features in the slick OS2 E-mail client. First, and most annoying when starting up with OS2, there is no "mark all as read" option. This matters when adding a new but exisitng account, as we are all doing now. Second,

  • Sorting order in iTunes power search?

    In iTunes power search, I enter some keywords and get a list for apps related with the keyword. I'd like to know in which order (sorting) apps are listed? weather they are most downloaded, rated, popular, or most visited or what? And further, is the

  • Can't locate print screen button W510 keyboard

    I just fired up a new W510 laptop today and can't seem to find the print screen button. Any help with this? Thanks Solved! Go to Solution.

  • Using a vector in Java IDL...URGENT!

    How can I use a vector in Java IDL? I am trying to have a function return a vector. From what I have read, I should use a sequence. Therefore I tried the following code:      struct ItemDB {           long ItemNumber;           long Quantity;        

  • HT201210 I,m trying to restore my phone but I keep getting Error code 21.... help please

    I,m trying to restore my phone but I keep getting Error code 21.... help please     iPhone 4S