Strange things can happen in Java:)

Hi to all of you.I just wanted to point out something that I consider as very interesting and not to mention even strange... I will welcome any comment.
Ok now the thing is that I have written a code that defines one interface name it Relation. I have these many classes implementing it. In the Relation body I have declared :
public static final Vector all = new Vector();
And then in all of the constructors of my classes that implement Relation I have written:
all.add(this);
That was just one idea of mine and I did not think that it should work but actually it would... I got all the object that I created in just one vector and on a later point I could access them...
Now the strangest thing is that this vector is final and static and how the hell I am getting all of the instances set in it???
Any ideas?

but isn't final just saying that I can not change the so
defined variable which in my opinion is even defined
as a constant on a later point??? I need a micrometer to find the meaning of that sentence.
And what do u mean by [etc]If you have a declaration:
public final Vector bob = new Vector();it's bob that is final, not the Vector object. So bob always points to that Vector, but the Vector itself is not immutable, so you can add stuff to it.
If you don't want bob's content's changed, use java.util.Collections.unmodifiableList. I believe this'll work:
public final List bob = Collections.unmodifiableList(new Vector());Now you have a field, bob, which points to an empty list that will remain empty forever.
And one more question is it ok if we instanciate
things in interface as I have done with the vector???Still waiting on that micrometer, sorry.

Similar Messages

  • I'm using Apple Mail 2.1.3 on a MacBook running OS 10.4.11. A very strange thing is happening. E-mail messages that I either sent or received months ago are showing up in my mailbox and receivers' mailboxes. Help!

    I'm using Apple Mail 2.1.3 on a MacBook running OS 10.4.11. A very strange thing is happening. E-mail messages that I either sent or received months ago are showing up in my mailbox and receivers' mailboxes. In one case, a message someone had sent to me wound up in the mailbox of a third person, who was not included in the address list!!  I have only two accounts, and have checked everything; only one account is showing the repeats Now, that account is my professional account, and it resides in three places: I use it on the laptop described here, I use it through Apple Mail on the much newer desktop Mac in my office, and I can run it through Web mail on my employer's server, which is where the professional account resides (I have a mailbox there, etc.) That program is called Zimbra.
    My personal account is with Earthlink and is not doing the repeats. I access it either through my MacBook's Apple Mail or the Web; the Apple Mail on my office Mac is not configured to access the Earthlink server.
    What IS going on here?? My friends, colleagues, and students (I teach college) are mystified by these ancient messages.
    Thanks for any help!!

    I'm using Apple Mail 2.1.3 on a MacBook running OS 10.4.11. A very strange thing is happening. E-mail messages that I either sent or received months ago are showing up in my mailbox and receivers' mailboxes. In one case, a message someone had sent to me wound up in the mailbox of a third person, who was not included in the address list!!  I have only two accounts, and have checked everything; only one account is showing the repeats Now, that account is my professional account, and it resides in three places: I use it on the laptop described here, I use it through Apple Mail on the much newer desktop Mac in my office, and I can run it through Web mail on my employer's server, which is where the professional account resides (I have a mailbox there, etc.) That program is called Zimbra.
    My personal account is with Earthlink and is not doing the repeats. I access it either through my MacBook's Apple Mail or the Web; the Apple Mail on my office Mac is not configured to access the Earthlink server.
    What IS going on here?? My friends, colleagues, and students (I teach college) are mystified by these ancient messages.
    Thanks for any help!!

  • I updated to FF4 and after a few days, strange things started happening. How do I recover to normal?

    I updated to FF4 and after a few days, strange things started happening.
    The groups I had set up disappeared and the Group button is gone.
    When I first open the app, it opens 8 - 12 separate windows with 1 blank tab. The orange Firefox button is there with nothing else on that bar. Also, 3 tool bars are blank (i.e. space is there but it's just grey) with NO buttons.
    If I want my previously opened tabs, I have to use the "Recently Closed windows" option to get back to where I was when I last closed down. The orange Firefox button is missing from this window but all the original menu items are back across the top.
    So how do I get back to the way it is supposed to operate?

    Have a look here
    Mac maintenance Quick Assist
    http://support.apple.com/kb/HT1147

  • Strange things are happening to my MacBook. Please help.

    Since buying my first MacBook nearly two years I have not had a single problem with it until earlier this week, when strange things started to happen.
    1) The first obvious problem was that my dock lost its settings.
    2) Then the green light at the top of the screen was on when I turned on my computer. Although this was resolved by shutting down and restarting, I have no idea why it was on in the first place.
    3) Thirdly, my email disappeared from Mail. After exploring, I found out that one of the check boxes in preferences had disabled my account and when I checked it again my email reappeared.
    4) And finally, it seems to be getting slower and slower. Whether it is opening a program such as Mail, opening system preferences or restarting, it all seems to be taking longer than I previously remember. However, once things are up and running they are generally fine.
    After doing some research I have found two possible fixes: resetting PRAM and resetting the System Management Control. The problem is that although I can read how to do them, I have no idea if they will fix my problems or what the implications of doing either are.
    So, do you think it would be a good idea to reset either the PRAM or SMC? If so, which should I do or what order should I do them in?
    Also, what, if any, are the risks of doing either? As I understand, my settings for things like the display will be reset but not things like wifi or the firewall, and all my programs, updates and files will remain untouched. Is that correct?
    Anyway, I hope that all makes sense and thanks in advance for any help you may be able to offer me.
    Paul

    Hmm, free space is okay, though some folks would say it's a little on the low side.
    How much RAM do you have in your computer?
    Also download SMART Utility here: http://www.volitans-software.com/smart_utility.php
    Run the application--it will give a report for your drive's physical health. If you get anything other than "Passed" you will probably need to replace the drive.
    ~Lyssa

  • All of the sudden FF is running very slowly & other strange things are happening as well???

    I have FF ver. 5 and for about a week now it is taking way longer than normal to load any and all pages. My OS is Windows 7 & I'm on a dual core processor computer that runs each processor at 3.40 GHz.
    I can't play any of my games because of how slow it is running. I'll click on a dropdown menu or something of the like like the "Tool's" menu and it will suck up so I'll have to push on it several more times before it will finally stay open and I can choose something. It also takes much longer for it to close down completely. Start up is running at normal for the most part. Every once in a while it will take a while to load and open. It has also been crashing way more than it ever has before and for no apparent reason.
    I've done everything I know to do like clearing cookies and history to no avail. I've even run a virus scan which only came up with some tracking cookies, no viruses or anything like that. I have also done a disk clean up and defragged (which I do every week).
    I know about 3 days before this started happening I updated the Java stuff and that's it.
    I'm at my wits end as I work on the internet for a living and this is making it very difficult and frustrating to get anything done.
    Please help!!!!!!!!!!! :( Cheryl

    -> Tap '''ALT''' key or press '''F10''' to show the Menu Bar
    -> Update ALL your Firefox Plug-ins https://www.mozilla.com/en-US/plugincheck/
    -> go to Tools Menu -> Clear Recent History -> '''Time range to clear: select "EVERYTHING"''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies, Cache''' -> click '''Clear Now'''
    -> go to Tools Menu -> Options -> Content -> place Checkmarks on:
    1) Block Pop-up windows 2) Load images automatically 3) Enable JavaScript
    -> go to Tools Menu -> Options -> Privacy -> History section -> '''Firefox will: select "Remember History"'''
    -> go to Tools Menu -> Options -> Security -> place Checkmarks on:
    1) Warn me when sites try to install add-ons 2) Block reported attack sites 3) Block reported web forgeries
    -> go to Tools Menu -> Options -> Advanced -> General -> Remove Checkmark from '''Warn me when websites try to redirect or reload the page'''
    -> go to Tools Menu -> Options -> Advanced -> Network -> Offline Storage (Cache): click '''Clear Now''' button
    -> Click OK on Options window -> Restart Firefox
    Check and tell if its working.

  • Strange thing just happened...

    I was using my Macbook and I just exited WoW, I then went to check out the Dashboard and clicked on a few widgets to see what they did. Then I X'ed out Dashboard. I tried to open Safari and the icon just kept on bouncing up and down in the dock and it would'nt open. I tried Firefox and iTunes as well but they did the same thing. I looked up at my menu bar and the intel core duo temp monitor showed i was at 98% usage and was at 83 degrees C. Then the cpu usage kept on jumping back and forth from like 50% to 80% and then back down. I had no applications open except for Adium and when that is on my cpu usage is always around 3%. What was going on? I kinda got scared and thought it was a sign of RSD so I shut down my MacBook and restarted it. Now everything is fine for the time being; any theories about what happened and how I can prevent it? Thank you
    iMac G5 17", MacBook White 1GB RAM, iPod mini   Mac OS X (10.4.2)  

    Whatever you shut down didn't actually shut down. The process hung and then a bunch of other processes started but couldn't fully execute. You did the right thing. You could also have tried the force quit menu and force quit things one by one to see.

  • Open a Telnet link with Firefox and bad things can happen

    I happened to come across a site with a number of links, and the one I chose happened to be a telnet link. Here was my experience, and I had to put myself into the shoes of the average user who knows nothing about programming.
    The link that caused Firefox trouble when Firefox was chosen to run it is this:
    telnet://dxc.nc7j.com:7300
    Click on the link and Firefox tells you that you need to select a program to open the Internet Shortcut Shell extension DLL. I have never heard of this, and I have no idea what to do here.
    Choose to open with Firefox.
    Now, if some error-handling routine had caught that Firefox, which is not capable of doing Telnet, was selected by the unknowing person behind the keyboard to go ahead and do Telnet, the error-handler would advise the user to the fact that this protocol is not supported and kill the process that is going to run out-of-control otherwise. Or cause to open the program that will run the Telnet session.
    Better yet, I clicked on the Telnet link and offer a better description of the choices.
    After all of what happened below, I installed Iron, a Chromium-based browser, and it opened a Telnet session window right away.
    So what did happen, I clicked on Firefox to do this chore and was greeted by a never-ending opening of empty tabs and upon closing the browser, it relaunched and was off to the races again. And again.
    OK so this ain't getting us anywhere.
    Firefox opens once again, this time hit the big red X to close it, and let the prompt to close however many tabs anyway prompt sitting there.
    I chose to run CCleaner, and I set that to blow away Firefox Cache and session. Run CCleaner, and tell it to force Firefox closed when it prompts that Firefox is open.
    If by chance Firefox launches again, timing was perfect that the file that was causing Firefox to open was not yet cleaned, so run the CCleaner again a few times. When Firefox is no longer opening, we are back to the world of sanity.
    Now, I could go in and reset the Tools Options Applications tab and look for Telnet, and replace the use of Firefox with "ask me."
    Fortunately, I know a little more than some about the computer, and I knew I had to use a utility to clear out the Firefox cache.
    You have a description of the issue in your knowledgebase, but it has Firefox opening endless empty tabs, but Firefox was closed and the situation is under control.. Restart Firefox manually, start a new session and then enter the Tools menu and fix the setting.
    There is a knowledge base article on this very topic, but it has the user close Firefox and then all is back to normal. One can open Firefox and get into the menu to fix the issue. There was a mention in there about malware as a possible cause of the constant reopening I experienced, but Malwarebytes scans were clean.
    "Well, this is embarrassing!" I have seen that nice touch to Firefox for many years, and may I compliment those who thought of that one.

    I agree, it can become a vicious circle.
    The default setting to try to restore all the windows and tabs automatically after a crash isn't the best setting. Personally I do change that so I get the "this is embarrassing" screen. So one option would be to file a bug report suggesting this be changed going forward.
    Another potential follow-up action would be to update the knowledge base article to better address how to recover in these situations. For example, a user could start up Firefox without restoring the previous session by:
    * Launching Firefox with a specific URL
    ** Using a desktop shortcut
    ** Using a link in an external application
    ** On the command line, typing firefox.exe "about:blank"
    ** (Possibly more ways to do it)
    * Renaming the sessionstore.js file in the profile folder
    ** On the plus side, preserves the option to restore that session later
    ** On the minus side, difficult for many users to find folders hidden by the OS, and the .js extension may be hidden by the OS
    Since the KB is a wiki, you can go in and make edits and improvements. The syntax is a bit funky, but not much worse than this forum.

  • Strange Things are Happening...

    Hello,
    Whenever I turn on or restart my Mac mini v. 10.4.3, it successfully logs in until it reaches the desktop. Then everything disappears, leaving only my background, and then reappears. However it disappears again and goes into an endless loop of everything - the top bar, the dock, any windows open, all icons on the desktop - disappearing and then, around 3 seconds later, reappearing. Whenever I try to start a program it doesn't start. The finder window will open and then disappear with everything else. I have to start my computer in Verbose mode and enter in a string of text (number 7 at http://docs.info.apple.com/article.html?artnum=106464 has the text I must enter). Is there anything I can do to stop my computer from doing this? I posted here before and got a fix, but as I said, it is only temporary. I must do that fix every time I log on. I'm looking to fix it once and for all.
    Thank you!

    Just a couple of things first. 1. Single-user mode isn't verbose mode. Thus, to boot into single-user mode, restart holding down the S key and not the V key. 2. Your problem appears to be the Finder crashing.
    Before redoing the steps in the document you cited, do this:
    Insert you install/restore disk.
    Reboot into Open Firmware: restart holding down the CMDOPT+OF keys. Then, type these in, sequentially, following each by the return key:
    reset-nvram
    set-defaults
    reset-all
    The last command restarts the machine; thus, hold down the S key to get into single-user mode.
    Once you do that, then type these in, sequentially, following each by the return key:
    mount -uw /
    mv /Library/Preferences/SystemConfiguration/preferences.plist preferences.old
    mv /Users/<yourusername>/Library/Preferences/com.apple.finder.plist preferences2.old
    mv /Library/Caches Caches_old
    chmod 1775 /
    reboot, holding down the C key.
    Click on the install icon, select Disk Utility from Utilities, and repair the disk and permissions, quit DU, select Startup Disk, select the Internal HD, and click restart.

  • N8-Social-client; strange things are happening !!!

    Hi, i just discovered a very strange issue with the social client on my N8; today is one of my FB-friends birthday and when i was checking this friends profile on my N8 there was already a post from myself wich i haven't written. I checked this friends profile on FB on my PC and there i could see that this post was actually from somebody else (wich of course it was since i didn't wrote anything). I logged out on my PC and checked again on my N8's social client and there again it shows my name and picture on that post. What is happening?
    N8-Wizard !!! Click the white star if you are happy with my help !!!

    Hmm, free space is okay, though some folks would say it's a little on the low side.
    How much RAM do you have in your computer?
    Also download SMART Utility here: http://www.volitans-software.com/smart_utility.php
    Run the application--it will give a report for your drive's physical health. If you get anything other than "Passed" you will probably need to replace the drive.
    ~Lyssa

  • A strange thing is happening when I try to upgrade to Leopard

    I have OS 10.4.11 and I own Leopard but when I try to install it, the computer does the scan thing and tells me that I need OS 10.4 or higher to install Leopard. But when I click on "About this mac" it tells me that i meet all the requirements and that I have 10.4.11
    So I can't figure it out! Why does my computer not see that I have the right stuff? Or if I don't why does it look like I do?

    Hi again, Snow Leopard/10.6 will not work on any G5, or G4, Leopard/10.5 is the latest you can install/run/use.
    You mentioned contacting Apple to get something that is now past it's era?
    Yes. 10.5 is getting late in it's life, but is the most modern OS you can run.
    Leopard requirements/10.5.x...
    * Mac computer with an Intel, PowerPC G5, or PowerPC G4 (867MHz or faster) processor
    minimum system requirements
    * 512MB of memory (I say 2GB at least)
    * DVD drive for installation
    * 9GB of available disk space (I say 30GB at least)
    You have to call Apple & likely ask for a Product Specialist to get it, if they still have it!
    Snow Leopard/10.6.x Requirements...
    General requirements
    * Mac computer with an Intel processor
    * 1GB of memory (I say 2GB at least)
    * 5GB of available disk space (I say 30GB at least)
    * DVD drive for installation
    * Some features require a compatible Internet service provider; fees may apply.
    * Some features require Apple’s MobileMe service; fees and terms apply.
    To be sure which Mac you have...
    At the Apple Icon at top left>About this Mac, then click on More Info, then click on Hardware> and report this upto *but not including the Serial#*...
    Hardware Overview:
    Machine Name: Power Mac G5 Quad
    Machine Model: PowerMac11,2
    CPU Type: PowerPC G5 (1.1)
    Number Of CPUs: 4
    CPU Speed: 2.5 GHz
    L2 Cache (per CPU): 1 MB
    Memory: 10 GB
    Bus Speed: 1.25 GHz
    Boot ROM Version: 5.2.7f1

  • Strange thing is happened

    I went to windows (restarting mac with bootcamp) for a win only program after I dunno 5-6 months, I had problems with bluetooth keyboard and mouse, and then I paired them with the win. everything worked fine I did my job successfully then return to my lovely mac.
    when to started on mac, my keyboard didn't worked. I said ok its a win/mac thing and I re-paired my keyboard. but it didn't worked. actually its worked but only for some keys!!! yea now they are working only and only functional keys of my keyboard, I mean every button except the numbers and the letter!!! other keys like enter, tab, all F1 F2 F3... keys, space, cmd keys are working
    isn't it strange? I tried to delete pairing and re-paired for 2-3 times but its all the same. I need your help. what is wrong with my keyboard??

    Here's your answer: http://discussions.apple.com/thread.jspa?messageID=8839614#8839614

  • After re-install, strange things are happening with my emails

    I had a crash during an optimization adventure with TechTool Pro when I was running 10.4.10. Since I had problems with this version (another issue), I did an archive and install for 10.4.8, with a subsequent upgrade to 10.4.9, and stopped there. So when I moved the mailboxes from the previous system folders to the active ones, my emails "disappeared". The mailbox windows are completely empty. In one mailbox, I "lost" nearly 2000 messages that I needed to archive. On my iMac, I have about 60% of those emails saved and backed up.
    I put quotes around "lost" and "disappeared" because I can open the files with TextEdit. They're complete and intact. But I can't open them up within Mail.
    I rebuilt the mailboxes, with no success.
    So what can I do to get Mail to recognize these invisible email files? Can anyone suggest a way to get Mail to recognize these files?

    Rather than tinkering with the contents of ~/Library/Mail/, you should have either restored the whole ~/Library/Mail folder as if it was a monolithic entity, or import the mailboxes by means of File > Import Mailboxes.
    That said, if Mail doesn’t recognize the messages in those mailboxes even after rebuilding them, chances are that importing them by normal means wouldn’t have worked either. In that case, you may try using emlx to mbox Converter or Emailchemy to convert the *.emlx files to standard mbox format, then import that in Mail as Other.

  • Strange thing - can only see correct part of clip AFTER I render it.

    Hey everyone. I don't normally bother people on the forum - and this isn't a crazy emergency - but something really odd has happened. I searched, but didn't see this exact issue, so here it is.
    I have a clip in the timeline - it's a different aspect ratio than the sequence settings. The sequence is 16x9 and the clip is 4x3 - so, I have to blow it up to fill the frame and avoid pillar boxing.
    Anyway, when I select my in/out points and drop it in the timeline, it's no where NEAR the portion of the clip I selected. It's not a frame or two off - it's off by a few seconds. However, after I render it - it's exactly the portion I selected.
    And, of course, anytime I apply an effect - it loses the render - and goes back to the wrong portion of the video.
    Now, full disclosure - these particular clips where screen captures and then exported to an editable format. But they played fine after I exported them, and they play fine in the preview. I have a feeling somewhere in that converting - it's goofing up. But I was curious if anyone has a thought as to the reason it's doing this?
    Hope everyone's projects are turning into successes!

    I use Voila - and then convert it. What is weird is that in the clip properties, it's says the clips is 10 fps - however, they were captured at 25 (don't ask why Voila is at 25 - they are working on a 30) - and then when I exported to QT, I added frames to get it to 30.
    And it looks fine - certainly not like 10 fps.
    I know this is where my trouble lies - somewhere in this conversion. I was able to edit with the footage, and I don't really use that screen capture to cut with full time - it was just in this case.

  • Strange things happening with fonts?!?

    Some strange things are happening with fonts. The following
    picture shows part of the problem. This is only occuring with IE 6.
    It doesn't happen in IE 7 or the current firefox. The information
    in the silver and white box is the problem. This is being pulled
    via spry and being displayed via a div tag. It shouldn't be bold
    faced. No code is telling it to bold face, yet it is.
    http://i211.photobucket.com/albums/bb305/silentbobsecret/fontissue.jpg

    Are you using a fade effect on it? If so, that's an IE bug,
    which has several workarounds which include setting the background
    color on whatever it is your are fading, or making sure that after
    the effect is done (via a finish function) making sure to remove
    any opacity related style on the element you just faded in.
    This sample also had that problem:
    http://labs.adobe.com/technologies/spry/samples/data_region/DetailRegionEffectsSample.html
    but we used the background color trick.
    --== Kin ==--

  • Lion and Mavericks (strange things going on)

    Hello everybody,
    I have a 2010 (white) macbook,
    I just installed Mavericks and updated it to 10.9.3. The macbook runs both 10.7 Lion (my main and most important partition) and 10.9, it's a dual boot.
    My partition with Lion is called ''Macintosh HD'' and the one with Mavericks is called ''OS X Mavericks''. (Mavericks is startup partition)
    Now i'm using both together some strange things are happening. First off when i opened Finder in Mavericks it only showed ''Macintosh HD'' like that was the partition Mavericks was installed on, now i've added the right partition in the sidebar of the finder (OS X Mavericks). This was already weird.
    When i went back into Lion everything was fine but it stated indexing ( i guess the mavericks partition ) this annoyed me because i want them to be seperate.
    So I went to settings > Spotlight > Privacy and added ''OS X Mavericks'' so Lion stopped indexing that part of my harddrive.
    When I went into Mavericks again, the spotlight on Mavericks was indexing and then randomly stopped. I went in to Setting > Spotlight and Privacy again.
    Only now in Mavericks. Guess what: in privacy ''OS X Mavericks'' partition was added.
    Is Mavericks reading from the wrong partition??
    Is spotlight running between two OS X versions?
    How can i make sure Mavericks is reading info from the right partition?
    It would be very nice if someone could tell me more about this..
    Thanks in advance !!

    I remember when Lion first came out, I installed a second Lion partiton and had issues similar to this. The MAS failed to work at all in the new Lion partition until I removed the original.
    I suspect there is something with Lion that only likes one OS X per drive.
    You might need to install Mavericks on an external drive rather than the second partition.

Maybe you are looking for

  • My iPod can't be read from or written to

    Having finally got through the rigmaroles of set up and iTunes, I have tried on a number of occasions to synchronise my new ipod nano 4gb. It manages to download/sync about 26 tracks then comes up with an error message "Attempting to copy to the disk

  • Web Clips in Safari 4?

    So I upgraded to Safari 4, where in the world did my little web clip button go that I had next to my URL bar in Safari 3? It's just not there anymore!!! How do I make a web clip with safari 4?

  • Booklet Printing - Alignment

    I am trying to print a Boolet in A4 but cannot get the correct asgnment.  It looks great in print preview, but when I fold it into a Booklet, the centrefold includes some of the left hand page.  The printer is a HP Photosmart Premuim 309a, operating

  • Why "Lighting Effects.plugin" in FIlter folder does not appear in the Rendering menu?

    Photoshop CS5 - I need to work with the "Lighting Effects.plugin". The plug-in is correctly installed into Adobe Photoshop CS5.1>Plug-ins>Filters but it NOT APPEAR rolling down the RENDERING menu!! How can I make it visible? Thank you

  • Finder and desktop icons frozen after time machine backup

    Finder desktop icons freeze every time after a Time Machine backup. *What's odd is that I can still use other apps, but I cannot select/open any item on the desktop*. Adding to the strangeness, +is that what's left after the backup is finished is a b