Is this Java Glossary entry for "static" correct?

Hi all,
I'm trying to understand static variables.
This glossary: http://mindprod.com/jgloss/static.html, has several lines that I don't think are correct, but I could certainly be wrong myself.
static final when applied to a variable is Javanese for "constant".
All static methods are automatically final. It is not strictly speaking an error to
mark them final, but it is redundant and considered bad form.I made a test class with a public static int x in it. I did not initialize the int. The compiler had no problems with it. I then made it a public static final int and the compiler (Eclipse, Java 1.5) complained that the int had not been initialized. Therefore, it seems to me that static and static final are different.
They can call instance methods only if they use their own object
references -- not rely on this.I made a class with a public static Object x. I then set x to be this in a method. The compiler had no problems with this.
Am I misunderstanding what the author means in the two quotes above?
Thanks!
Tim
Edit: Woops, the above quotes talk about methods, not variables. Shouldn't the same be true of variables, though? How can a static constant relay on 'this"?

TimQuinn wrote:
Hi all,
I'm trying to understand static variables.
This glossary: http://mindprod.com/jgloss/static.html, has several lines that I don't think are correct, but I could certainly be wrong myself.
static final when applied to a variable is Javanese for "constant". This is correct.
All static methods are automatically final.This is incorrect.
public class Scratch {
  final static void foo() {}
class ZZZ extends Scratch {
  static void foo() {}
}Notice the difference when Sractch.foo is declared final vs. when it's not.
I made a test class with a public static int x in it. I did not initialize the int. The compiler had no problems with it. I then made it a public static final int and the compiler (Eclipse, Java 1.5) complained that the int had not been initialized. Therefore, it seems to me that static and static final are different.Yes, they are.
Note, however, that final means something different for a variable than for a method, and that Roedy was talking about both in the same paragraph.
They can call instance methods only if they use their own object
references -- not rely on this
I made a class with a public static Object x. I then set x to be this in a method. The compiler had no problems with this.Because the calling method wasn't static. He's saying a static method can call an instance method only if it has it's own reference to an instance, since there is no this in a static method. He is correct.

Similar Messages

  • Any notes for this issue 2 entries for 1 material while searching material

    Hello All
    Internal goods and services
    search material which has more than one UOMs.
    When i search material for internal goods and services i get two entries for one material . i know the reson why it dispalys two same items since it might have alternate UOM but however you select any one of the item it will be order unit only as UOM.
    Why SRM system showing two enties for one material with same item . enduser may dismay what item item needs to select.
    this must be protected right? Any suggestion not to show tow items while searching one material.
    Clue:- MARM - ecc table has Alternate UOMs entries fort he material. Any one is facing this problem ?
    br
    muthu

    Hi. I just tried it on our SRM 4 system (I know it's old, upgrade soon hopefully) and I can see the alternate UOM in MARM and also in SRM in COMMPR01, but I only get 1 hit in the search help.
    Are you sure you haven't got the same material replicated twice into SRM from 2 different backends or something? Can you see the logical system in the search? Check table COMM_PRODUCT to see if there is more than 1 entry for the material maybe?
    If it is the same system and the UOMs causing the problem It seems a bit odd that SAP would introduce this on a new system, have you tried raising a message with them?
    Worst case you always have the BBP_F4_READ_ON_ENTRY / BBP_F4_READ_ON_EXIT BADI's.
    Regards,
    Dave.

  • Java.security entry for login module configuration

    I am running JAAS-Example from SUN with Tomcat.
    When I am creating an object in my servlet by LoginContext = lc = new LoginContext(�SampleLoginModule�); getting *�cannot create Logincontext. Unable to locate a login configuration�* Exception.
    Before that i am doing below setting:
    In JAVA_HOME/jre/lib/security/java.security I am defining login.config.url.1=file:${java.home}/lib/security/jaas.config
    After that I put �jaas.config� file at ${java.home}/lib/security/
    Jaas.config
    ===========
    SampleLoginModule {
    sample.module.SampleLoginModule required debug=true;
    Do anybody have solution for my this problem,why I am getting this error?
    Thanks for your help and understand !!!

    Hi,
    We also experienced that limitation when a vendor is connecting to our XI SOAP Sender Adapter. It is asking for basic username/password. What we did was to create a Generic XI user with a password on it and use SSL authentication at the same time. Our Scenario was PI --> XI --> SAP R3, with the PI system using an HTTP RFC destination with a Basic Logon and Active SSL option to connect to the same system as yours https://host:portnumber/XISOAPAdapter/MessageServlet
    Let me know if this helped...
    Regards,

  • Creating source system: No entry for BW_USER in table RSADMIN available

    Hi,
    When i try to create source system in RSA1, when I choose SAP system from Release 3.0E (Automatic creation), I get this message:
    No entry for BW_USER in table RSADMIN available.
    What do I have to do to create source system.
    RFC connection are already made.
    Best regards,
    Uros

    hi Uros,
    you need to maintain ale user,
    rsa1->settings->global settings->glob settings
    enter bw user ale. normally ALEREMOTE is used.
    oss note 410952
    Symptom
    You receive the error message when trying to connect a source system to the Admininistrator Workbench:
    "No entry for BW_USER in table RSADMIN exists" (message number RSAR 059).
    Additional key words
    RSAR059, APO, RSADMINA
    Cause and prerequisites
    In table RSADMINA, the BW user is not maintained for ALE.
    Solution
    Maintain the entry using the following path:
    Call Administrator workbench (transaction RSA1).
    From the 'Settings' menu, select Global Settings'.
    If an entry already exists in the field "BW user for ALE", delete this.
    Enter the correct names for the BW users in this field.
    Save the entry.
    You must restart the Administrator Workbench (RSA1) now.
    The source system can now be linked without errors.
    hope this helps.

  • What is mean by "No entry for BW_USER in table RSADMIN availablea'

    Hi All,
    While creating Source system in my system i am getting this message "No entry for BW_USER in table RSADMIN available" , What is mean by this?
    Reply back me to [email protected]
    Regards,
    Kiran

    hi Kiran,
    means no aleremote user maintained for bw, you can maintain via rsa1->settings->global settings->glob settings enter bw user ale. normally ALEREMOTE is used.
    Creating source system: No entry for BW_USER in table RSADMIN available
    hope this helps.
    oss note 410952
    Symptom
    You receive the error message when trying to connect a source system to the Admininistrator Workbench:
    "No entry for BW_USER in table RSADMIN exists" (message number RSAR 059).
    Additional key words
    RSAR059, APO, RSADMINA
    Cause and prerequisites
    In table RSADMINA, the BW user is not maintained for ALE.
    Solution
    Maintain the entry using the following path:
    Call Administrator workbench (transaction RSA1).
    From the 'Settings' menu, select Global Settings'.
    If an entry already exists in the field "BW user for ALE", delete this.
    Enter the correct names for the BW users in this field.
    Save the entry.
    You must restart the Administrator Workbench (RSA1) now.
    The source system can now be linked without errors.

  • Outlook to iPhone sync failure – Sync suddenly stopped working for calendar events but continued for contacts and notes.   Finally Fixed!!!  SUPPORT TEAM – PLEASE SEE THIS – Complete explanation of cause and correction steps.

    The issue:  Outlook to iPhone sync failure – Sync suddenly stopped working for calendar events but continued for contacts and notes.   Finally Fixed!!! 
    SUPPORT TEAM – PLEASE SEE THIS – Complete explanation of cause and correction steps.
    The cause:  It is now clear what caused this problem.  For years I had several “all-day” events in my Outlook calendar (birthdays, anniversaries, etc.).  In May 2012 I decided to make some of them one hour  events so I could add alerts to remind me of the event.  I did this by dragging them in Outlook to the time I wanted and expanding them to the time slot desired and then adding the alarm.
    The symptom:  Syncing stopped working for the calendar but continued working for contacts and notes.  I didn’t realize sync was failing until months later when I missed two very important phone calls, so when I noticed it the cause was not obvious. 
    The failed attempts:  I’m head of a software firm and my calendar sync is a crucial to my business life so I took this on with a vengeance.  From a quick look at events in Outlook and the iPhone I could see that the problem started in May 2012.  Events before May were in both Outlook and the iPhone but events after May were only one or the other.  Unfortunately I had changed several other things at the same time relating to other events so again the cause was not obvious.  MANY calls with AppleCare proved them incompetent so my internal IT guys assisted trying many things.  We tried a huge number of calendar changes and several versions of iTunes, iPhone OS and Office as well as both iPhone 4 and 5, all without success.
    The fix:  After 18 months of frustration, MANY  hundreds of $ expense and MANY hours of wasted time I saw a blog that had a calendar sync  problem and it indicated all day events were related.  I changed the display of the Outlook calendar to the list view, added columns so I could see “all day” event check marks as well as times of events,  sorted on the “all day” event column to move them to the top, and for all events that were “all day” events AND had a start and end time, I removed recurrence and then added the annual recurrence back…
    After I fixed all events that had BOTH “all day” set and had a start/end time, I tried another sync.  It synced for the first time in 18 months! 
    Problem occurred May 2012 – fixed Nov 2013

    Hi, to remove dummy '_ModGrp' entries, rather than crashing the 'Suppr' key on your keyboard, you can use this basic VBA macro (launched for instance from Excel).
    It will recursively remove all '_ModGrp...' folders
    Sub RemoveFolders_Click()
        Dim oOutlook As Outlook.Application
        Set oOutlook = New Outlook.Application
        Set objNameSpace = oOutlook.GetNamespace("MAPI")
        Call CleanFolders(objNameSpace.Folders)
    End Sub
    Sub CleanFolders(objFolders As Outlook.Folders)
        For i = objFolders.Count To 1 Step -1
            If Left(objFolders(i).Name, 7) = "_ModGrp" Then
                objFolders.Remove( i )
            Else
                If Not objFolders(i).Folders Is Nothing Then
                    Call CleanFolders(objFolders(i).Folders)
                End If
            End If
        Next i
    End Sub

  • What's This Help not working for one entry in each header file

    I have a large RoboHelp project that I have imported into Version 8 from a previous version. Prior to the import into Version 8, all of the What's This Help in the project was working perfectly; now, post-import, I have a problem.
    Firstly, some background information.
    My project contains a large number of individual header (.H) files, one for each dialog within the software. These header files, which have been generated and provided by our developers, contain one entry for each field on the dialog to which the header file relates. The header files are all contained within a \HTML Topics\Fields\ folder (going from the root of my Help project).
    Each header file has a corresponding text (.TXT) file. These text files contain entries that correspond to the entries in the relevant header file. The text files are also contained within the \HTML Topics\Fields\ folder.
    Below is an example of the contents of a header file:
    #define IDH_HIERARCHY_APPEARANCE_HIEARCHY_LIST          16811
    #define IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE         16812    
    #define IDH_HIERARCHY_APPEARANCE_REMOVE_APPEARANCE      16813
    Below is the contents of the corresponding text file:
    .topic IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE
    Click this button to add a new row of hierarchical appearance settings to the grid.
    .topic IDH_HIERARCHY_APPEARANCE_HIEARCHY_LIST
    Use this grid to define hierarchy appearance settings. Each row in the grid represents a level of the hierarchy. For example, the appearance settings you define for the first row apply to the top level of hierarchy, the settings you define for the second row apply to the second level, and so on.
    .topic IDH_HIERARCHY_APPEARANCE_REMOVE_APPEARANCE
    Click this button to delete the selected row of hierarchical appearance settings from the grid.
    The What's This Help that was part of the original project still works perfectly. However, after upgrading the project to RoboHelp Version 8, I have had to update the project to reflect changes to the software. As part of this work, I have imported some new header files and updated some existing ones - and edited the corresponding text files accordingly.
    The What's This Help that is covered by the header files that I have imported since the upgrade to RoboHelp Version 8 does not work correctly; in each case, the What's This Help does not work for whichever field appears at the top of the appropriate text file. The position of the entry in the corresponding header file does not make a difference.
    If I manually edit a text file to move a different entry to the top then recompile the Help project, the What's This Help does not work for the field that now appears at the top of the text file - and the What's This Help for the field that used to appear at the top of the text file now works.
    I've tried everything I can think of to fix this, but nothing has worked. It seems as if there is a problem in the way RoboHelp is compiling the header and text files.
    If I use Microsoft HTML Help Workshop to decompile the CHM file, then view the contents of the resulting, decompiled text files, the affected files appear as follows:
    .topic IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE
    Click this button to add a new row of hierarchical appearance settings to the grid.
    .topic 16811
    Use this grid to define hierarchy appearance settings. Each row in the grid represents a level of the hierarchy. For example, the appearance settings you define for the first row apply to the top level of hierarchy, the settings you define for the second row apply
    to the second level, and so on.
    .topic 16813
    Click this button to delete the selected row of hierarchical appearance settings from the grid.
    Note how the entry at the top - which relates to the What's This Help that doesn't work - appears differently to the other entries which do work. The name of the ID appears after ".topic" rather than the appropriate ID number.
    Any help that anyone can provide me with would be very much appreciated.
    Thank you,
    Mark

    Its working now. We just kept trying to reinstall the tools and restarting indesign. On the 4th time the buttons started working. I can't explain why it finally worked, just that it is working now.

  • How can i  apply this  java program for  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }//my text file name is: "input.eqn" (given below)
    input:Enter Value1:arg1
    input:Enter Value2:arg2
    input:Enter Value3:arg3
    constant:arg4
    constant:arg5
    Equation:arg1+arg2+arg3
    result:

    how can i apply this java program for a jsp pagewhy do you want to do this ?
    Your program reads from a file on the disk and formats based on a patterm.
    Jsp is not intended for such stuff.
    ram.

  • Correct entry for /var/run/slapd.pid

    what is the correct pid for slapd?
    my os x did not come with slapd.pid so I'm
    trying to create one manually, but I don't
    know what I'm supposed to use.
    also any one know the correct entry for
    /var/run/slapd.args?
    Thanks,
    Tadashi

    what is the correct pid for slapd?
    my os x did not come with slapd.pid so I'm
    trying to create one manually, but I don't
    know what I'm supposed to use.
    When slapd is running it saves its pid in the file /var/run/slapd.pid
    This allows other processes to find its pid to use to communicate with it.
    You do not need to create this file.
    also any one know the correct entry for
    /var/run/slapd.args?
    Similar to above, this is created by slapd. You don't need to worry about it.
    The better question is why is slapd not running (assuming your machine is set up to be an OD Master).
    HTH
    - Leland

  • Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-

    ok friends,
    have a normaly running project in eclipse and want to create a jar file...i tried ewerythin in ->export but nothing function
    i wanted to create a runnable jar file but that error ecures:
    JAR export finished with warnings. See details for additional information.
    Exported with compile warnings: ICQJJ/src/ICQJJ.java
    Jar export finished with problems. See details for additional infos.
    Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-5.1.8-bin.jar'
    what's the problem?
    ok, i am using a mysql db und using the driver mysql-connector-java-5.1.8-bin.jar....
    i improted this jar file like this run -> run configuration -> classpath -> add external jar....
    pls help me

    That looks like it might be a binary-distribution JAR that you should unjar. The actual JAR for the classpath is probably inside it.

  • Static Arp Entry for Exchange 2010

    Hello All,
    I was hoping someone could assist with an issue that our Exchange team are having, specifically with replication traffic traversing our DC to DR site.
    The infrastructure consists of a Layer 3 data centre and a disaster recovery site, so essentially its a live/backup environment. Both the DC and DR site are connected with a LES using routed interfaces.
    The Exchange cluster at the DC is associated with the following subnets:
    MAPI - 10.1.30.X
    Replication: 10.1.230.X
    DR site has the following subnets associated with the exhange cluster :
    MAPI - 192.168.4.X
    Replication - 192.168.230.X
    When an attempt is made to create a database/mailbox on an exchange server at the DC and copy it using  the replication subnet source: 10.1.230.X to destination subnet: 192.168.230.X, the copy process fails.
    Replication traffic in general going from DC to DR or vice-versa is subject to constant problems and seems unreliable. Our exchange team have to manually copy mailboxes from one cluster to the other using Windows explorer which works fine.
    The Exchange cluster at both sites reside within a VMWare ESX enclosure and connect to Cisco 6500 switches. Would the Cisco switches require a static arp entry for their respective Exchange clusters, which should be configured on each switch? If this was missing could this be the root cause of the replication problems we're experiencing? Or does this depend on whether the exchange cluster is using NLB Unicast or Multicast mode?
    Any assistance would be most appreciated.
    Regards,
    Jamie

    Jamie,
    Have a look at this link:-
    http://www.cisco.com/en/US/products/hw/switches/ps708/products_configuration_example09186a0080a07203.shtml
    It depends on how the team NLB is set up.
    You may need static mac & static arp as well as disabling igmp snooping if multicasting is bein used.
    Regards,
    Alex.
    Please rate useful posts.

  • I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too

    I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too. Last a few months i have not use this phone. Just i start to use again. So most probably i gave my old mail address as a ID or password. So how can i clearing this subject. regards

    ErolSinan wrote:
    ... there is no button for update between the About and Usage buttons in the General. ...
    Correct. That is only a feature of iOS 5 or later...
    ErolSinan wrote:
    ... yes my phone is 3G.
    then it can only go as far as iOS 4.2.1

  • FF not connecting to web- This "Network Connections" message pops up: Error 623: The system could not find the phone book entry for this connection. Any ideas?

    About a month ago I could no longer connect to the internet on our PC. Every time I clicked on the Firefox icon the Netscape sign-on window would pop up. I would try to close it but it would pop up over and over again. If I tried to close it a dozen or so times eventually Firefox would open up but it would never connect. Just today I moved my Netscape file to the recycle bin. No longer does the Netscape sign-on window pop up but following Network Connection error message pops up: "Error 623: The system could not find the phone book entry for this connection".. This error window behaves the same way the Netscape sign-on window used to behave. Every time I click to close it it pops open again. After numerous clicks Firefox opens up but it never connects.

    Do you have this error message on a Mac computer or on a Windows computer?
    I've only seen this error mentioned on a Windows computer.
    *http://kb.mozillazine.org/Autoconnect

  • I tunes 11 will not let me sync my I pod nano... keep getting error meessage:  the software required for this I pod was not installed correctly... I have tried to reinstall 6 times Dumped everything i tunes related no luck help!

    I recently updated to Itunes 11 and now no sync... get error message: The software required for this I pod was not installed correctly. Please reinstall Itunes to install the required software.  I backed up all music and deleted all related itunes items and still get this error after 6 attempts to reload itunes... i give up please help

    I recently updated to Itunes 11 and now no sync... get error message: The software required for this I pod was not installed correctly. Please reinstall Itunes to install the required software.  I backed up all music and deleted all related itunes items and still get this error after 6 attempts to reload itunes... i give up please help

  • " software for this i phone is not installed correctly. reinstall iTunes"

    Hi guys
    I managed to get iTunes to open but now I receive a warning message "software for this i phone is not installed correctly. reinstall iTunes", when connecting my iphone and ipad as well... reinstalling itunes does not solve the problem.
    I tried removing the latest itunes from my registry and installing the previous version that worked, hence the problem persist.
    I'm sure i'm not the only victim out there.
    Pls guys, any advise on how do i fix this problem.
    Thanx
    calypso2

    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

Maybe you are looking for