Is the instance fields have private accessibility in String class?

Is the instance fields have private accessibility in an immutable class, such as the String class?
also Could any one answer the following question,
(This is the question I got in written exam for job recruitment)
"Invoking a method can represent a significant amount of overhead in a program; as such, some compilers will perform an optimization called "method inlining." This optimization will remove a method call by copying the code inside the method into the calling method."
Referring to the text above, which one of these statements is true?
Choice 1 The performance benefits should be balanced against the increased chance of a RuntimeException.
Choice 2 It allows the use of getter and setter methods to execute nearly as fast as direct access to member variables.
Choice 3 This optimization will only occur if the relevant methods are declared volatile.
Choice 4 The developer of inlined methods must copy and paste the code that is to be inlined into another method.
Choice 5 It prevents code from executing in a way that follows object-oriented encapsulation.

Sarwan_Gres wrote:
Is the instance fields have private accessibility in an immutable class, such as the String class?Usually, but not always.
"Invoking a method can represent a significant amount of overhead in a program; as such, some compilers will perform an optimization called "method inlining." This optimization will remove a method call by copying the code inside the method into the calling method."The java compiler does not inline methods so this is not relevant to Java. (The JVM does inline methods) The java compiler does inline constants known at compile time but it is a feature causes more trouble than good IMHO.

Similar Messages

  • Does the iPhone 5 have message access profile

    Does the iPhone 5 have MAP message access profile?

    Not sure; I haven't seen any documentation on it but I assume it would work for the 3GS or higher.  (Doesn't look like this has been updated to include the MAP feature: http://support.apple.com/kb/HT3647.)

  • Does the APPS schema have full access to custom objects

    DB - 11.2.0.3 - s390 - SLES11SP2
    APP - 12.1.3 - x86_64 - SLES11SP2
    One of my lead developers has posed a question to me.......namely -
    Does the APPS user have implicit select and delete privileges on custom objects without an explicit GRANT statement?

    Please see (Step By Step Guide to Creating a Custom Application in Applications 11i [ID 216589.1]) which is applicable to R12 as well -- "Grant all privilege from each custom data object to the APPS schema" step.
    Please also see (Step 9. Integrate your database objects with the APPS schema by granting APPS the access to your custom schema’s objects) in (Integrating Custom Applications with Oracle Applications [ID 176852.1).
    Thanks,
    Hussein                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • The static field should be accessed in a static way

    Hello,
    I am developing a java app in eclipse and I am getting the error message:
    The static field Calendar.DAY_OF_WEEK should be accessed in a static way
    I am trying to get the first day of the first week in the current month, here is my code:
    GregorianCalendar firstDayOfThisMonthCalendar = new GregorianCalendar(Calendar.YEAR, Calendar.MONTH, 1);
    int firstDayOfThisMonth = firstDayOfThisMonthCalendar.DAY_OF_WEEK;I though the problem was that I'm supposed to write the code like this:
    firstDayOfThisMonthCalendar.get(Calendar.DAY_OF_WEEK); but then I get the wrong value back

    That's what I critice about u people, always ready to
    complain, It's not complaining. It's pointing out problems with your code. You should thank him.
    but do u put the code in here the way that
    someone could read it ? Easy to say 'use
    simpleDateFormat. Oh, careful, January returns 0, not
    1'.Using SimpleDateFormat is an easier and more correct way to do it. Trying to use the numerical value of the month constants is incorrect coding. You should thank him for educating you.
    Why can't u write the code in here so there's no
    chance that somebody will ask again.Such code is not possible. No matter what code you write, somebody can misunderstand it.
    If you write the code correctly--using SimpleDateFormat--then the code will be correct (which is the most important criteria) and clear (which is important, but not as important as correctness).
    But if you prefer to think that your way is always perfect and are afraid to admit your mistakes and learn from them, that's your prerogative.

  • The following fields have multiple writable mappings: field name

    Hi,
    I keep getting this error when I map
    tables to EJB 2.0 CMP.
    What does exactly mean ?

    It means that you have mapped multiple mappings/attributes in your bean to the same database fields. Single only one of the mappings can write the value TopLink requires to know which one it should use, you must make the other ones read-only.
    Check your mappings and make sure they are not mapping the same fields, make sure you check 1-1 mappings and they map the foreign key fields (TopLink does not require that you have attributes for the foreign key fields). You may also have incorrectly mapped a 1-1 target foreign key relationship.

  • Can I publish a PDF to the web and have others access it and use weblinks within the document?

    Is it possible to publish a PDF to the web and have the viewers be able to click on links within the document.  I'm asking because I found a PDF file WebQest online and it allowed me to click on the links.  How did they do that?

    What is your operating system?
    Can you open that PDF with a text editor and check that the first four characters are '%PDF'.

  • Have apple tv 2g and several IDevices (ipad, iphone..)and around the house i have several access point connect via UTP cable to the same router/modem, but  when i try Airplay it wont work if the devices are on dif wifi conn. regardelless its the same LAN.

    Problem with Homesharing/Airplay with dif IDevices (Itunes with a PC, Iphone, Ipad, Itouch etc) using my home wifi connections that has several access point throu out the house and they all are connected via UTP cable to the same modem/router (My LAN).
    When i try to use airplay or homesharing both devices have to in the same ACCESS POINT (it does not mather if its WIRED or WIRELESS, i have the same problem with both).
    Any ideas?? This did not happen before i upgraded ITUNES in order to use IOS5.
    Thanks

    Thanks for the advice. But i dont have any devices sync wifi. It also happens with older versions of IOS on iphone 4.2.1 and 3.1.3 and also IOS5 (no wifi sync enable).
    Basiclly when i try to airplay music using itunes (pc) to my apple tv 2g (4.3.3.) they both have to be in the same access point, if the apple tv is connect via UTP cable i have to be connected to that access point wifi. Basicly dosent work with dif access points.  Also if i manage to be on the same access point (itunes using a pc and the apple tv) if i have to use Remote App to change songs i have to be in the access point to.. can not see the devices...
    Any ideas?

  • Need to delete icloud as its on an old email address and cannot remember the password!  Have not access to old email account

    Can anyone help my son has icloud on his phone but registered on my old email address and we cannot delete it as we cannot remember the password... I no longer have access to email address to cannot get them to resend password.

    As long as you are going to be able to verify to Apple that your son is account owner, they may be able to help you to reset password.

  • I want to remove the option to have private browsing on my sons iPhone.  Any idea how?

    How can I remove the option for my son to switch on private browsing on the iPhone.  Can I disable this option?

    No. But, you can install another browser such as McGruff and then disable Safari in Restrictions.

  • When "Save Link As..." is used, file permissions are changed so that other users of the same computer have full access.

    I have a laptop running Windows Vista Ultimate, and I'm not sure what's been changed in my Firefox, but now, every time I use "Save Link As...", the user permissions for the file have been set to include "USERS" which is then indicated by an icon in the bottom left corner of the file thumbnail. The icon is of the two people you see under "User Accounts and Family Safety" in the Control Panel.
    I do remember a dialogue box coming up saying something about "This file originates from another computer and may be harmful..." or something along those lines when this problem first occurred.
    I thought that problem would only occur for files from one website, but now, whenever I try using "Save Link As...", the user permissions for that file are incorrect.
    If I open the link and download the file manually, it's perfectly fine.

    It seems that the difference between the sites that will open and the one that won't is the Default Authentication provider is set to NTLM on those that open, and Negotiate (Kerberos) on the one that won't. The Authentication Provider for the Default zone
    is Claims Based Authentication on all the sites, just site B (which won't open) is set to Negotiate (Kerberos), the others are set to NTLM.
    Short term: can I change the provider to NTLM without destroying the site?
    Long term: point me in the direction for setting up Kerberos correctly on my server/farm, as from what I can tell Kerberos is the recommended path forward. I'll setup a non-production test site and get it figured out.
    Thanks much.
    Steven

  • Where do I find the Instance Name for EPM Batch Script Utility?

    I am trying to find the Instance Name for the EPM Batch Script Utility. I have done the obvious...looked at the Deploy settings in EPM, but the Instance field is not even listed. I have tried 'Default', 'localhost', 'Planning', 'epmsystem1' and " " (nothing).
    Anyone know where I can look? The script will not deploy without this option (I have tried removing the field altogether). This is the error I am getting:
    2012-12-05 03:02:21,908 INFO Parameters(ApplicationName, InstanceName, ApplicationServer, HubProject, datasourceName, waitForCompletion, deployOption, RefreshOutline, CreateSecurityFilters)
    2012-12-05 03:02:21,909 INFO Values('BKAdFund', 'Default', 'PLANNING_LWA', 'Planning', 'BKAdFund', 'True', 'All','True', 'True');
    2012-12-05 03:02:23,149 ERROR [Line 16] Unable to find the instance with name Default.
    Thanks!

    Hi all,
    I referred Andy's suggestion to set both App Server name and instance name as PLANNING_LWA.
    It worked in Planning 11.1.2.3
    My deploy string set as followed:
    set bpmaserverurl=http://localhost/hyperion-bpma-server;
    set workspaceurl=http://localhost:9000/workspace;
    login;
    Execute Deploy
    Parameters(ApplicationName, InstanceName, ApplicationServer, HubProject, ClearAll, CheckIntegrity, waitforcompletion, purgeTransactions,  deployOption,  datasourceName,CreateOutline,RefreshOutline,CreateSecurityFilters,SharedMembersSecurityFilters,ValidateSecurityFilterLimit,Notes)
    Values ('HRPLN1', 'PLANNING_LWA', 'PLANNING_LWA', 'Planning', 'false', 'false', 'true', 'true', 'AppView','HRPLN_DS','false','true','false','false','false','HRPLN1 redeploy by batch client');
    Thanks Andy!!

  • The New Field in the FBL5N/FBL1N doesn't appear

    Hi guys,
    I created an APPEND STRUCTURE with the NAME1 field in the table RFPOS and through the transaction FIBF an Event that calls a Function and move the Name of Customer or Supplier according to the transactions FBL5N or FBL1N.
    This field, NAME1, should appear in these transactions when the user choices the hidden fields through the Change Layout button. But this field doesn't appear...
    I debbuged the Function Module and the data have been moved. (It works...)
    Please, someone did it before and could help me to solve it?
    Why doesn't the Field NAME1 appear? What could I do??
    Thanks a lot!
    Regards,
    Marcos Fernando Dotta

    Hi
    The new fields have to be appended in the structure RFPOSX too, and then you need to run the program RFPOSXEXTEND in order to add the new fields in layout structure RFPOSXEXT
    Max

  • How do I convert the ASCII character % which is 25h to a hex number. I've tried using the scan value VI but get a zero in the value field.

    How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field. 

    You can use String to Byte Array for this.

  • Certificate [Thumbprint SOME THUMBPRINT] issued to 'CLientMachineName' doesn't have private key or caller doesn't have access to private key.

    Hi,    We are trying to get a client to communicate with the primary Config Manager Site System(MP/DP).
    We have a Config Manager Client Template that was setup using this guide. 
    http://technet.microsoft.com/en-us/library/gg682023.aspx
    We have a Client Cert on the primary site system server (primary config manager server)  based on this template and it meets the requirements specified in this document
    http://technet.microsoft.com/en-us/library/gg699362.aspx
             Enhanced Key Usage value must contain
    Client Authentication (1.3.6.1.5.5.7.3.2).   
             Client computers must have a unique value in the Subject Name field or in the Subject Alternative Name field.
             SHA-1and SHA-2 hash algorithms are supported.
             Maximum supported key length is 2048 bits.
    The Cert that we generated for the client meets the same requirements and shows the exact same template id but has a different subject name and alternate name (which is the clients machine name).
    With this setup, we still get the following error
    Certificate [Thumbprint  SOME THUMBPRINT] issued to 'CLientMachineName' doesn't have private key or caller doesn't have access to private key.
    Both the site system and client have the same trusted root cert installed.
    What are we missing or what can we check?    Does the cert check process only need the client certs on both the site system and the client to be from the same template?
    Here is a snippet of the clientidmanagerstartup.log
    <![LOG[HTTPS is enforced for Client. The current state is 63.]LOG]!><time="15:02:32.057+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="ccmutillib.cpp:395">
    <![LOG[Begin searching client certificates based on Certificate Issuers]LOG]!><time="15:02:32.058+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3833">
    <![LOG[Certificate Issuer 1 [CN=THE_NAME_OFTHE_CA; DC=DOMAIN; DC=LOCAL]]LOG]!><time="15:02:32.058+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3849">
    <![LOG[Based on Certificate Issuer 'THE_NAME_OFTHE_CA' found Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.082+300" date="03-12-2014" component="ClientIDManagerStartup"
    context="" type="1" thread="716" file="ccmcert.cpp:3931">
    <![LOG[Begin validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.082+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1245">
    <![LOG[Completed validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1386">
    <![LOG[Completed searching client certificates based on Certificate Issuers]LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3992">
    <![LOG[Begin to select client certificate]LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="ccmcert.cpp:4073">
    <![LOG[Begin validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1245">
    <![LOG[Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME' doesn't have private key or caller doesn't have access to private key.]LOG]!><time="15:02:32.086+300" date="03-12-2014" component="ClientIDManagerStartup"
    context="" type="2" thread="716" file="ccmcert.cpp:1372">
    <![LOG[Completed validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.086+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1386">
    <![LOG[Raising event:
    instance of CCM_ServiceHost_CertRetrieval_Status
        ClientID = "GUID:GUID";
        DateTime = "20140312200232.090000+000";
        HRESULT = "0x87d00283";
        ProcessID = 6380;
        ThreadID = 716;
    ]LOG]!><time="15:02:32.090+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="event.cpp:706">
    <![LOG[Failed to submit event to the Status Agent. Attempting to create pending event.]LOG]!><time="15:02:32.092+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="2" thread="716"
    file="event.cpp:728">
    <![LOG[Raising pending event:
    instance of CCM_ServiceHost_CertRetrieval_Status
        ClientID = "GUID:GUID";
        DateTime = "20140312200232.090000+000";
        HRESULT = "0x87d00283";
        ProcessID = 6380;
        ThreadID = 716;
    ]LOG]!><time="15:02:32.092+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="event.cpp:761">
    <![LOG[Unable to find PKI Certificate matching SCCM certificate selection criteria. 0x87d00283]
    Thanks Lance

    Hi,
    It seems that there are something wrong with you PKI system.
    Here are some steps for your reference.
    SCCM 2012: Part II – Certificate Configuration
    http://gabrielbeaver.me/2012/08/sccm-2012-part-ii-certificate-configuration/
    Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Trying to access a private attribute of a class in the same package

    Hi,
    I have defined a private attribute in a class
    class Sample {
         private String newString = "hello";
    in another class I am trying to access newString attribute using reflection api. It is throwing hte following exception
    java.lang.NoSuchFieldException: value
         at java.lang.Class.getDeclaredField(Unknown Source)
         at refletionpack.mainclass.main(mainclass.java:20)
    any ideas how to do it exactly? Should stringclass.getDeclaredField("value")
    have the field name(newString) as a parameter?
    public class mainclass {
         static Class stringclass = Sample.class;
         static Field stringCharsField = null;
         public static void main(String args[]){
              try{
                   stringCharsField = stringclass.getDeclaredField("value");
                   stringCharsField.setAccessible(true);
                   char[] stringChars = (char[])stringCharsField.get("newString");
                   System.out.println(stringChars);
              }catch(NoSuchFieldException ex){
                   ex.printStackTrace();     
              }catch(IllegalAccessException ex){
                   ex.printStackTrace();     
    }

    Hi,
    to obtain the value of your private attribute you have to change two lines of code. At first you have to tell your class and not the field that private attributes can be accessed by using stringClass.setAccessible(true);After that you have to specify the name of the attribute to obtain which is called newString in your class which results in
    stringCharsField = stringClass.getDeclaredField("newString");For the invocation of the method get(Object) you need an object first that is an instance of the analyzed class by calling Object sample = stringClass.newInstance.
    Then you can retrieve the actual data of the requested field by calling String string = (String) stringCharsField.get(sample);A simpler solution would be when you make your attribute newString static. Then you can omit the necessary object for the retrieval of the attribute data and the line would result in String string = (String) stringCharsField.get(null);.
    For further issues considering reflection you should read the appropriate API.
    Hope it helps.

Maybe you are looking for