Hi All, which is better while creating an object

Hi All, which is better while creating an object,
for ex:
public class Joe {
public void disp() {
System.out.println("Joe.disp");
(1) Joe j = new Joe();
j.disp();
(2) new Joe().disp();
of course, both are equal, which is better in performance perspective

I suggest you just write code and when the assignment is done, AND you have a performance issue, only then try to improve things. The question you're asking now is likely of no relevance to the performance of you application.
You can run your application through a profiler to see what specific part of it is consuming (too) much memory.

Similar Messages

  • WHAT ALL MESSAGE'S ISSUED WHILE CREATING PO

    Sir,
    ply let me know after saving the po i want to know what all messages were issued while creating the po.
    Like "warning" or "information" message
    where  can i see this
    regards
    amey

    Hi,
    PAth- Spro-MM-Purchasing-Environment Data-Define Attributes of System Messages...
    Here are few message type:
    Contract has different purchasing organization &     W
    Validity period of contract does not start until &     W
    Validity period of contract expired on &     W
    Target value of contract & exceeded by & &     W
    Net price for item & taken from conditions     W
    Purchase requisition & item & already deleted     W
    Scheduled quantity & & greater than target quantity & &     W
    Quantity smaller than invoiced quantity &     W
    Target quantity exceeded by  & &     W
    Not possible to determine a consumption account     W
    Release date lies in the past     W
    Base unit of measure & adopted from material master record
    Release date: next workday is &     W
    Contract target value & reached     W
    Please only use plants with company code &
    Order unit copied from material master record     W
    Hope it helps.
    Utsav..

  • Error while creating PDF object

    We are using Adobe Interactive Forms with Guided Procedures.  Netweaver 7.0 SP14 (Dual stack Java & Abap).  All was working well it appears until we configured SSL for ADS - don't know for sure if this caused the problem but it is the only change we can identify around the time that our problems began.
    When we attempt to Create an Impersonalized Form we receive the following error -
    Cannot retrieve template structure: Execution ended in an unrecognized state
    When we attempt to test a callable object associated with an interactive form we receive -
    Error while creating PDF object: PDF object could not be created; object returned from ADS is null.
    In both cases the entries in the default trace log are the same -
    Service XMLFormService: Native process (PID=0) /usr/sap/UFD/DVEBMGS02/j2ee/os_libs/adssap/XMLFormService/bin/XMLForm.exe terminated abnormally with error code 134
    PDF object could not be created; object returned from ADS is null
    com.sap.caf.eu.gp.base.exception.EngineException: PDF object could not be created; object returned from ADS is null
    at com.sap.caf.eu.gp.model.iforms.adapter.pdf.AdobePDFAdapter.createInstanceDocument(AdobePDFAdapter.java:542)
    at com.sap.caf.eu.gp.model.iforms.preproc.FormPreprocessor.execute(FormPreprocessor.java:507)
    Like I mentioned earlier this functionality was working successfully in our environment at one time.
    Any guidance in this matter would be greatly appreciated.
    Thanks,
    Joe

    Joe,
    If you originally configured ADS without SSL, I would recommend going back through the ADS Configuration Guide for your NetWeaver stack and make sure all the necessary changes for SSL were made.  I've seen another case where a step was missed in SSL configuration for ADS which caused a form to error.
    If everything looks good based on your SSL configuration, I would recommend creating an OSS Note.
    -Matt

  • Error while creating Temse Object (W2 form in PU19)

    Team,
    When i try to create the w2 in PU19, i am getting the error statingthat ERROR WHILE CREATING TEMSE OBJECT HRLUS01A100900109026.Please advise me in this.(We are maintaining the HRSP-42).It is veryurgent,Expecting your valuable Guidance.Points sure for the answers.
    Regards
    Priya.K

    Hi
    let me know weather r u using any reference object which contain the routinee.
    regards,
    chandra.

  • Error while creating info object

    error while creating info object a character
    Info object may be a maximum of  000060 digits...... what would be the error?
    Thanks ALL

    Hi,
    The maximum length supported by one CHAR type infoobject is 60. Check whether you have assigned more.
    If you have to load more length ( more than 60) split the total thing into different infoobjects. Create different infoobjects and split the total thing into them - like 1st 60 char in 1st infoobject, char 61-120 in 2nd infoobject and so on. Then you can again concatenate them.
    Thanks,
    Indrashis

  • Linker Error while creating shared object.

    While creating shared object we got "file processing error".
    Below is our compilation line and the error out put.
    ==================
    /net/icom3/opt//SUNWspro/SC5.0/bin/CC -o fn_ctx_onc_fn_files.so.1 -G -h fn_ctx_onc_fn_files.so.1 -z text -z defs -z combreloc -norunpath -nolib -Qo
    ption ld -R/usr/lib/fn pics/FNSP_filesOrgContext_default.o pics/FNSP_filesFlatContext_default.o pics/fnsp_internal_common.o pics/FNSP_nisAddress.o
    pics/FNSP_nisOrgContext_default.o pics/FNSP_nisFlatContext_default.o pics/FNSP_hash_function.o pics/FNSP_filesHierContext.o pics/FNSP_filesDotC
    ontext.o pics/FNSP_filesFlatContext.o pics/FNSP_filesHUContext.o pics/FNSP_filesWeakSlashContext.o pics/FNSP_filesPrinternameContext.o pics/FNSP_
    filesPrinterObject.o pics/FNSP_filesOrgContext.o pics/FNSP_filesImpl.o pics/fnsp_files_internal.o pics/onc_fn_files.o -lnsl -lc -L/user/vts/X
    FN_CHECK/jnk/usr/lib/fn -lxfn -lfn_spf -lfnsp -lfn_p
    ld: fatal: File processing errors. No output written to fn_ctx_onc_fn_files.so.1
    ==================================
    Thanks in advance.
    -Lokesh MS

    Hi,
    The maximum length supported by one CHAR type infoobject is 60. Check whether you have assigned more.
    If you have to load more length ( more than 60) split the total thing into different infoobjects. Create different infoobjects and split the total thing into them - like 1st 60 char in 1st infoobject, char 61-120 in 2nd infoobject and so on. Then you can again concatenate them.
    Thanks,
    Indrashis

  • What are the naming conventions we should follow while creating an object

    hi
    what are the naming conventions we should follow while creating an object in ABAP dictionary, i.e while creating zee table.

    Hi,
    Namespaces and Naming Conventions
    SAP has reserved name ranges for customer objects and SAP objects. Use these customer name ranges to make sure that your objects are not overwritten by SAP objects during the import of corrections or an upgrade.
    This documentation lists the customer name ranges for the different system objects.
    Only use the customer name ranges. If you do not keep to the name ranges for customer objects you may lose your development objects.
    SAP delivers a few system objects with names that fall within the customer name range. These objects already existed when the customer name range was extended from YY/ZZ to Y/Z. These objects are listed in table TDKZ.
    Regards

  • Getting Error while creating Document object  after  parsing XML String

    Hi All,
    I have been trying to parse an XML string using the StringReader and InputSource interface but when I am trying to create Document Object using Parse() method getting error like
    [Fatal Error] :2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    seorg.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    Please find the code below which i have been experimenting with:
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.StringReader;
    import java.util.List;
    import java.util.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import java.io.*;
    public class TestMain {
         public static void main(String[] args) {
              String file = "";
              file = loadFileContent("C:\\Test.xml");
              System.out.println("contents >> "+file);
              parseQuickLinksFileContent(file);
    public static void parseQuickLinksFileContent(String fileContents) {
    PWMQuickLinksModelVO objPWMQuickLinksModelVO = new PWMQuickLinksModelVO();
         try {
    DocumentBuilderFactory factory =           DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         StringReader objRd = new StringReader(fileContents);
         InputSource objIs = new InputSource(objRd);
         Document document = builder.parse(objIs); // HERE I am getting Error.
         System.out.println(document.toString());
    What is happening while I am using builder.parse() method ???
    Thanks,
    Rajendra.

    Getting following error
    [Fatal Error] :2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    seorg.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

  • Error while creating Business Object

    Hello All,
    I am creating one business object for the Chapter ID. But while creating API method the error message is coming up as "Parameter <parametername> does not have a reference structure".
    But I already defined BAPI Structure which has the required fields and also i follow the Std. naming convenions.
    Kindly guide me for the same.
    Egarly Waiting for the reply.
    Regards
    Nilesh Shete

    Hi Nilesh,
    could you please go a bit more into detail?
    Best would be to post the interesting parts of your source code here.
    At the moment I can only guess that you created an adaptive RFC model. But did you also create a context node and bind the model to it?
    What do you mean with "creating API method" and "I am creating one business object for the Chapter ID"?
    Regards
    Helmut

  • Error while creating DiscoveryClient object

    Hi,
    i have an issue creating DiscoveryClient object. I tried to solve this by granting all permissions and THEN generating the secret but i still the same Exception.
    public string discoveryId = "https://api.office.com/discovery/";
    public string cmmAth = "https://login.windows.net/Common";
    public async Task<OutlookServicesClient> EnsureClientCreatedAsync()
    try
    string authority = cmmAth;
    _authenticationContext = new AuthenticationContext(authority);
    DiscoveryClient discoCli = new DiscoveryClient(async () => await GetTokenHelperAsync(_authenticationContext, discoveryId));
    CapabilityDiscoveryResult discoResult = await discoCli.DiscoverCapabilityAsync("Calendar");
    var outlookCli = new OutlookServicesClient(discoResult.ServiceEndpointUri, async () => await GetTokenHelperAsync(_authenticationContext, discoResult.ServiceResourceId));
    return outlookCli;
    catch (AdalException e)
    MessageBox.Show(e.ToString());
    if(_authenticationContext != null && _authenticationContext.TokenCache != null){
    _authenticationContext.TokenCache.Clear();
    return null;
    public async Task<string> GetTokenHelperAsync(AuthenticationContext context, string resourceId)
    string accessToken = null;
    AuthenticationResult result = null;
    ClientCredential cliCred = new ClientCredential("xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy=");
    result = await context.AcquireTokenAsync(resourceId, cliCred);
    accessToken = result.AccessToken;
    return accessToken;
    and my AdalException is
    AADSTS70001: Application with identifier xxxxx-xxxx-xxxx-xxx-xxxxx was not found in the directory api.office.com
    thx for any Help
    Maciej 

    Hi,
    What the application type did you develop with: Web Application or Windows Client Application?
    To use Office 365 API in ASP.NET Web Application, I suggest you referencing the sample project
    O365-ASPNETMVC-Start.
    internal static async Task<OutlookServicesClient> EnsureOutlookServicesClientCreatedAsync(string capabilityName)
    var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
    var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    AuthenticationContext authContext = new AuthenticationContext(SettingsHelper.Authority, new ADALTokenCache(signInUserId));
    try
    DiscoveryClient discClient = new DiscoveryClient(SettingsHelper.DiscoveryServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(SettingsHelper.DiscoveryServiceResourceId,
    new ClientCredential(SettingsHelper.ClientId,
    SettingsHelper.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);
    return new OutlookServicesClient(dcr.ServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
    new ClientCredential(SettingsHelper.ClientId,
    SettingsHelper.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    catch (AdalException exception)
    //Handle token acquisition failure
    if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
    authContext.TokenCache.Clear();
    throw exception;
    return null;
    For Windows client application, you could get the token by using the code as following:
    private async void GetToken()
    string authority = "https://login.windows.net/Common";
    AuthenticationContext authenticationContext = new AuthenticationContext(authority);
    string discoveryResourceId = "https://api.office.com/discovery/";
    String clientId = "{Client ID}";
    Uri redirectUri = new Uri("http://localhost/{return GUID}");
    var token = authenticationContext.AcquireToken(discoveryResourceId, clientId, redirectUri);
    Regards,
    Jeffrey
    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.
    Click
    HERE to participate the survey.

  • Problem while creating DS Object

    Hello All,
    While creating a DataStore Object named :"0OI_TSW_DS03",I am getting a message "Name OI_TSW_DS03 after prefix 0 has to have spaces between 3 and 8".
    Is it because the no:of letters in the DS Object name exceeded a certain limit or any other reason?
    Thanks in advance,
    Chintu.

    hi Chintu,
    1. you shouldn't use prefix 0 for your own created objects.
    2. maximum name for ODS is 9 characters.
    see following oss note
    hope this helps.
    i guess you are using nw2004s, there is dedicated forum for nw2004s
    /community [original link is broken]
    160317-Customer namespace for objects in the Business Warehouse (BW)
    Symptom
    This note provides information on the customer namespace for objects in BW 12B and BW 2.0, BW 3.0, BW 3.1, BW 3.5 with the standard character set.
    Other terms
    Customer namespace, BW12B, BW20, BW30
    Solution
    Info object:
    Length: 3 - 9 characters.
    Must start with a letter from A - Z.
    Permitted characters:
    Alphanumeric characters, single underscore.
    Non-permitted characters:
    Double underscore, non-alphanumeric characters, German umlauts, underscore at the end of the name.
    Description long CHAR 60.
    Description short CHAR 20.
    Hierarchies:
    Length: 30 characters (technical name).
    Non-permitted characters:
    Non-alphanumeric characters.
    Description long CHAR 60.
    Texts:
    Description long CHAR 60.
    Description medium CHAR 40.
    Description short CHAR 20.
    InfoSource:
    Transaction data:
    Length: 30 characters.
    First character must be a letter from A-X (as of BW 2. 0 A-Z)
    Permitted characters:
    Alphanumeric characters, underscore.
    Non-permitted characters:
    Blank characters, non-alphanumeric characters, German umlauts.
    Description long CHAR 60.
    InfoCube:
    Length: 3 - 9 characters.
    First character must be a letter.
    Permitted characters:
    Alphanumeric characters, underscore.
    Non-permitted characters:
    Blank characters, non-alphanumeric characters, German umlauts.
    Description CHAR 60.
    Query:
    Length: 30 characters.
    First character must be a letter or an underscore.
    Description CHAR 60.
    Aggregate:
    Description CHAR 30.
    InfoPackage, InfoPackage groups:
    Description long CHAR 60.

  • Updation problem while creating multiple objects from enterprise portal

    Hi All,
    From enterprise portal i am calling an RFC 'BAPI_PROJECT_MAINTAIN' to create objects .
    While trying to create multiple objects simultaneously it gives error "sapuser is currently using, can't be created".
    It seems like as i am creating multiple objects by calling RFC repeatedly , while the first one is not updated fully i am sending the second value to be processed.
    Pl. tell me how to overcome this. Do I need to add any sleep time in EP or any other method is there in SAP to overcome this situation.
    thanks
    sandeep

    Dear Sandeep,
    I have discussed this problem with EP team lead in my organisation, i have given your email id to him he will forward the solution on your id.
    If usefull reward points helpfull....
    Regards,
    Rajneesh Gupta

  • SAP BW ERROR OCCURS WHILE CREATING ODS OBJECT

    HI TO SAP BW GURUS
    AFTER CREATING ODS OBJECT,AND ODS OBJECT STRUCTURE,WHILE ACTIVATING THE STRUCTURE I AM GETTING MESSAGE AS
    <b>message : STDO:LOG COULDNOT BE WRITTEN ON OUTPUT DEVICE T</b>
    COULD ANYONE PLS TELL ME HOW TO RECTIFY THT
    VENKAT

    Read the information message carefully. Then proceed, if you intend to have custom  "standard" texts (sort of an oxymoron, but everyplace I've been does this)...
    If you are working in a customer system, only create standard texts using the following naming convention:
    Initial letter Y or Z in the text name with any text ID
    or
    Initial letter Y or Z in the text ID with any text name

  • Which is better ? Toplink Java objects or Toplink Entities ?

    Hi
    We are planing to use Toplink JPA that comes with JDeveloper 11g preview release
    I have a question here!
    I would like to get clarified which is better to use :
    1. Toplink Java Objects from Tables ,
    2.Toplink Entities from Tables
    Could you suggest the best approach, and pros and cons of both the approaches?
    Thanking you ,
    Samba

    Samba,
    Ultimately both are using the same TopLink runtime. In the case of Entities you are using JPA and Java Objects you are using TopLink native API and metadata.
    Going forward I would recommend JPA with TopLink extensions as required.
    Doug

  • Getting error while creating callable object

    Hi,
    I've created and deployed a DC using webdynpro.
    Now I want to create a callable object from portal
    I'm choosing the following options Guided Procedurers-->DesignTime>Create callable object-->userinterface>webdynprocomponent(GP interface)
    On entering the required data on the displayed page, when I'm clicking 'next' option it is giving <b>"500 internal server error"</b>.
    Can somebody help how to resolve this.
    Thanks
    Piyush

    your callable object component is missing. try to take preview of the iview and check.

Maybe you are looking for