Not understanding "synchronized key word"

Hello all,
I have a singleton class as below
package test;
public class TestClass {
    private final static TestClass testClass = new TestClass();
    private TestClass() {
        super();
        // TODO Auto-generated constructor stub
    public static TestClass getInstance() {
        return testClass;
    public  synchronized void keepRunning() {
        for (int i = 0; i < 10454564564l; i++) {
            for(int j=0 ; j<242342342342l;j++){
                System.out.println(j);
}And two other classes which take the reference and call keepRunning simultaneously as shown
package test;
public class TestClass1 {
    public TestClass1() {
        super();
        // TODO Auto-generated constructor stub
     * @param args
    public static void main(String[] args) {
        TestClass testClass = TestClass.getInstance();
        testClass.keepRunning();
}and
package test;
public class TestClass2 {
    public TestClass2() {
        super();
        // TODO Auto-generated constructor stub
     * @param args
    public static void main(String[] args) {
        TestClass testClass = TestClass.getInstance();
        testClass.keepRunning();
}Now if i run both TestClass1 and TestClass2, i can see sysouts from both the programs. I am not able to understand Why synchronized key word allowing TestClass2 to acess the code.(As there are no shared variable)

ohhhhhhhhhhh!!!!! Sorry ! I am ashamed of myself!! :-(

Similar Messages

  • What happen if my i Tunes window in my PC COME IN espanyol language but i need to convert into english language, so how ? because i not understand the spanish wording.

    how can i convert my i Tunes with espanyol into english language in my pc or i-phone?

    Hi,
    OK. That means the default display lange of the OS is Thai. That is what was purchased. 
    You can try downloading  and using the  language appropriate LIPS (language interface package software) from Microsoft to change the  display language.
    Best regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Problems with the key word function

    Have recently acquired Lightroom.   I uploaded my photos into Lightroom and have pretty much key worded all of them. I have had something happen which I am not sure why and hope you all can enlighten me.  I did a search for Flower and my flower photos showed up along with a bunch of other photos. These other photos did not have the key word flower yet they appeared in the group. Any idea why?  Thanks in advance.
    Mike

    Thanks for responding.  I did try your suggestion and only those photos with flower appeared.  I just solved my problem though I don’t know why it happens.  When I selected text at the top of the window, I left the other fields alone.  This time I changed any searchable field to Keys words and that caused only the key worded photos to appear.  I till don’t understand why leaving “any searchable field” the way it is would cause this.  I could understand if all the photos then appeared but they don’t only a few.
    Anyway thanks for responding, I appreciate it.  I wonder if anyone else has experienced this?
    Mike Crosa

  • CRES encrypted mails even without the 'key' word

    Hi
    We have CRES enabled, and it does send out encrypted mails when we type in our "key" word in the subject or body.
    The issue is at times, when the selected user sends non-encrypted mails, the subject and the body of the email does not contain
    any of the "key" words, it even then encrypts the mail and sends it accross.
    We have observed this for a couple of users, so we removed these users from the Allowed list of users, who can encrypt their email,
    and re-inserted these users to encrypt, the mail, it works fine for them now.
    But now again another set of users are complaining of the mails being sent out as encrypted, thought they are not having any
    "key" words that are needed to send out the mail as encrypted.
    Any one faced this kind of issue or any work around for this, kindly advise.
    Regards,
    Tauseef

    Hi Tauseef,
    I would recommend you to use the Message Tracking so you can understand the message flow. The message is probably triggering the Encryption action.
    You could also use the Trace feature at:
    System Administration -> Trace
    So you can simulate a message and how the Cisco ESA will handle the message.
    If you are not confortable sharing the config (policies/filters) and the tracking in the forum, I would suggest you to open a TAC ticket so an Engineer can assist you identifying what is causing the message to be encrypted.
    I would say your Cisco ESA will not encrypt the message without a clear command to do so. The only question remaining is what is causing the action to encrypt to be triggered. I believe you know, but action can be triggered in a message filter, in a content filter and in a DLP policy. There is another option, using the Plug-in for encryptign the message locally but since you did not mention this, I am guessing this is out f the list. I would recommend reviewing the configuration and the message tracking data. That way you can determine what is causing the messages to be encryted.
    If you need further assistance from the forum, please share more data.
    I hope this helps.
    -Valter

  • TS3694 I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    Restore iPhone with current iTunes on computer. See if better. If still problem, make Genius reservation or set up Service and take or send to Apple for resolution. Of if easier for you, take receipt and iPhone, box and everything and return to where you bought it.

  • What are all the key words are not recommented in User Exit or Enhancement

    Dear Experts,
    Can any of one tell me, what are all the key words not recommended to use any of the User exit or Enhancement spots?
    Regards,
    Mohana
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Feb 22, 2011 4:10 PM

    No Icon:Visitor
    Student
    Honor Student
    Top Student
    Tutor
    Intern
    Teacher
    Grad Student
    Master’s Graduate
    PhD Student
    Associate Professor
    Professor
    Distinguished Professor
    Regents Professor
    Associate Dean
    Dean
    Provost
    FONDA X. COX, PhD

  • How do I Change sub category to a key word tag in Elements 6. When I right click the sub category is the possibility to change not selectable

    I want to change a sub category to a key word tag in Elements 6. When I right click the sub category is the possibility to change not selectable. How to do it?

    If you want to change the category you need to change the feed, which means changing it in WordPress. You need to pick one category and, if there is one, one sub-category from the official list here:
    http://www.apple.com/itunes/podcasts/specs.html#categories
    It is possible to have further categories, though I don't know whether WordPress will allow that, but you should put the most relevant one in first.
    Once you've amended it simply re-upload the feed and wait for the Store to catch up. You don't need to resubmit.

  • Will not export photo. pop up says Some export operations were not performed. This file could not be opened(1). Also when I try to add a key word to ohoto the screen keyboard opens and I do not have a touch screen monitor.I have uninstalled LR6 and re-ins

    will not export photo. pop up says Some export operations were not performed. This file could not be opened(1). Also when I try to add a key word to photo
    the screen keyboard opens and I do not have a touch screen monitor.I have uninstalled LR6 and re-installed and it still does the same thing??????

    <moved from Downloading, Installing, Setting Up to Photoshop Lightroom>

  • 3.0 EA3, Key-Words should not be translated at all.

    Hi all,
    at first my compliment to the dev team. The raptor is about to fledgeup ....
    A little hint (not a real problem):
    From the Schema Browser chose a table (mark it via mouse) and Drag it into the SQL area. A dialog box appears with radio buttons to pick up the action of your choise.
    In german the translation is a bit silly. Don't translate these texts here - it makes no sense.
    OK is: Insert = INSERT and update = UPDATE.
    But "Löschen"= DELETE is strange, and "Wählen" = SLECT is simply silly at all.
    To make a long story short, Key-Words should not be translated at all.
    Thank you!
    Andre

    Unfortunately, the custom style sheet "feature" is still horribly broken, even in the latest 3.0.3. Setting a file in the preferences still doesn't set the correct URI in the preferences (either that, or Safari still doesn't know how to use a Windows file path to locate the style sheet).
    I'm also encountering problems where Safari will crash when using an ad blocking custom stylesheet.
    Also, when having the custom stylesheet set, trying to use the "Inspect Element" feature will crash Safari.

  • Key words not attaching

    I have recently exported my LR catalogue and images to a new computer.  No problems there.  BUT, my key words have not attached themselves to the images.  If I click on an image in a folder no keywords appear in the key word box, but, if I select all the images in the folder then all the key words for that folder appear in the key words box with asterisks beside each key word.  Now I do know that if I then selectively go through the folder I can retype and reattach each key word to its proper photo, BUT, I have over 100,000 images and this method may take half a lifetime.  I'm not going to live that long!!! Help please.

    Randy, when you open the Keyword Manager, are your keywords shown there?
    From the Window menu:
    Window > Keyword Manager  ⌘K
    That will tell you, if your photos have the keywords you assigned. Are all keywords listed, that should be there?
    Are the albums that are missing smart albums, based on keywords?
    Then try to recreate them using the command "File > New Smart Album" and select a rule "Keyword is ...."

  • My  BEATS speakers are connected to my Mac but I have no audio and do not understand how to turn off the speaker. I press the power button and not shut off. And the white light behind me indicating that this synchronized, does not turn off ever.

    My  BEATS speakers are connected to my Mac but I have no audio and do not understand how to turn off the speaker. I press the power button and not shut off. And the white light behind me indicating that this synchronized, does not turn off ever.

    Hello Sabroso007
    Check out the article below to troubleshoot the sound output to your Bluetooth speaker. Check in System Preferences > Sound to see what the output is set to.
    OS X Mavericks: Set up Bluetooth audio devices
    http://support.apple.com/kb/PH14217
    Regards,
    -Norm G.

  • ABAP key word documentation  not appearing

    Hi every one
    when i press F1 on a keyword in ABAP editor it displaying ABAP keyword documentation with blank page.
    i am using vista OS and SAPGUI 6.0 and Internet explorer 7.0
    Please suggest me what to do to get the Key word help.
    Most useful answer will be awarded
    Thank you
    Kiran

    Check transaction ABAPDOCU. This shouldn't be dependent on which version of SAPGUI you have (assuming your sap rel is 4.6 or greater).
    Also look in table tstct for transaction abapdocu.
    If it doesn't exist then you need to re-install it. Should be part of standard SAP however.
    VISTA is irelevant in this regard - however you might need to access the SAP help files via a browser and a manual link as the automatic link doesn't work properly under VISTA unless SAPGUI 7.0 is installed -- as the previous poster has said.
    For the SAP library you can always use a manual link to the sap help data files but of course it won't work via F1.
    Cheers
    jimbo

  • SQL Developer Data Modeler not drawing foreign key relationships

    I'm having trouble with SQL Developer Data Modeler when I importa a DDL that has foreign keys. I export DDL files from SQL developer and choose various subsets of files. Sometimes Data Modeler will not recognize a foreign key if I include say a dozen files in the DDL file, but it will if I include just a few. Worse, even if the foreign key is recognized, sometimes it is not drawn in the Data Modeler and I have no way to make it be drawn. To be specific, I import a file containing the DDL for just two tables -- I see the foreign key! I import a file containing the DDL for a dozen tables including the two, I don't! Is there something I am not understanding about when Data Modeler will draw foreign keys or is the tool simply quite buggy?
    Much thanks!
    -ttamon

    Hi Philip,
    I believe I have isolated the problem. Apparently if a field is named "FOREIGN..." it interferes with the tool recognizing foreign keys. Try to import a DDL file containing the following text:
    CREATE TABLE "SAMPLE"."SAMPLE_ONE"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "VALUE" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ;
    CREATE TABLE "SAMPLE"."SAMPLE_TWO"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "FOREIGN_NAME" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ;
    CREATE TABLE "SAMPLE"."SAMPLE_THREE"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "VALUE" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "ALT_ID" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ENABLE,
         CONSTRAINT "FK6DF8294F2288190D" FOREIGN KEY ("ALT_ID")
         REFERENCES "SAMPLE"."SAMPLE_ONE" ("ID") ENABLE
    TABLESPACE "SAMPLE_DATA" ;
    You will discover the foreign key is not recognized or drawn! Now, if you swap the location of the third table (put it up first) everything works fine. This is how I discovered the problem, various subsets would work, others would not. To confirm the problem is with the field named "FOREIGN_NAME" use the DDL as specified above but change the first letter in the word "FOREIGN" to something else, and it will recognize the foreign key. Looks like a bug to me (took me about 4 hours to isolate this!). I am using Oracle SQL Developer Data Modeler version 2.0.0 Build 584.
    -ttamon

  • How usnig manuplate the Import and export Key word.

    How usnig manuplate the Import and export Key word? and
    how do the clear of those variable?

    HI ,
    For IMPORT Keyword :---
    To retrieve data from the global memory area, use the IMPORT statement.  The most basic form of the IMPORT statement is:
    IMPORT <variable> FROM MEMORY.
    To give the variable a different name in your program from what it is called in the global memory area, use the TO clause.  You must define the local variable name with a DATA statement in your program.  The format is:
    IMPORT <global var> TO <program var> FROM MEMORY.
    As with the EXPORT statement, you can specify multiple variables per statement, and you have the option of specifying which cluster ID you wish to import from.
    After each IMPORT statement, SY-SUBRC is set to indicate whether or not the cluster ID you specified exists (but not whether specific variables were imported specifically).  SY-SUBRC is zero if the cluster exists.
    It is also possible to IMPORT and EXPORT to database tables .
    ABAP memory that is used to store exported data is user and transaction specific, so when passing data between programs in this manner you must make sure that transaction boundaries are not crossed. Otherwise the contents of this memory will get destroyed and will not be available to the importing program.
    For Export Keyword :---
    The EXPORT statement moves data from your program into a global memory area.  The most basic form of the EXPORT statement is:
    EXPORT <variable> TO MEMORY.
    This places the specified variable into a global memory area that another program can later read using the IMPORT statement.
    You may specify multiple fields in the same EXPORT statement.  For example:
    EXPORT KNA1-KUNNR KNA1-BUKRS TO MEMORY.
    You can give variables a different name in the global memory area using the FROM clause.  For example, the following code exports SY-SUBRC and gives it the name RETVAL in the global memory area:
    EXPORT RETVAL FROM SY-SUBRC TO MEMORY.
    You can specify a cluster ID when exporting data to memory.  You can freely choose the name of the cluster ID, which can be up to 32 characters long.  Each cluster ID specifies a particular area in memory.  Each time you EXPORT data to the same cluster ID, all data previously written to that ID is erased.  For example:
    EXPORT SY-SUBRC TO MEMORY ID u2018LJS1u2019.
    Hope u understand
    Thanks
    Shambhu

  • About key word return

    Hi;
    Iam very confused about the use of the key word return. I understand its functionality when it returns some value.But what's the case when we use it in the following way:
    if(some testcase)
    return;
    Also where will return leads to when we use only return in a method that has void return type.

    Hi;
    Iam very confused about the use of the key
    word return. I understand its functionality when it
    returns some value.But what's the case when we use
    it in the following way:
    if(some testcase)
    return;:eek:
    IMO a ``test case'' is not a language construct.
    http://en.wikipedia.org/wiki/Test_case

Maybe you are looking for

  • How do I add a background color to a document in Pages?

    How do I add a background color to a document in Pages?  I have made an invitation, with a photo in it, the text is in color, and I want to make the background pink instead of white.  thanks

  • Problem with Chroma/Lume Keys while using Drop Shadows

    I have been using the box now for almost two years and I still am getting problems with green/blue/purples artifacts showing up after a chroma/luma key has been applied with a drop shadow. The artifacts do not show up under a preview but only when th

  • Problem with cd player

    I am trying to play a cd on my toshiba satellite l305 (vista) but when I load the cd I hear it  but it won't play so  I then select the media center and select from the options but it still will not play.  What am I doing wrong?

  • OWB Runtime Audit Browser

    Hi, I am not not able to open the Runtime Audit Browser. Before doing the above steps ,i configured the Internet Explorer Browser as per the installation Configuration Guide documentation.I did the following settings. I. To add "localhost" to your In

  • AME CS4 Crashes on Startup

    Hi I have been useing AME CS4 along with PPro and the rest of the Production Premium suite for some time now.  All of which are installed on a windows machine running Vista 64bit with Matrox Axio LE hardware. Yesterday AME was working fine and today