How to access the private constructor??

i have a one private constructor in which i define some important variables then how should i access that private constructor?(Is this related to singleton class? if possible give me some example )

Hi
you can access to your private constructor through static methods of that class.
you can create objects of that class using these static method.
example code
public class rrr
     public static void main(String[] args)
          a ao=a.getobj(30);
          System.out.println(a.geti(ao));
class a
     private int i;
     private a(int x)
          i=x;
     static a getobj(int y)
          return new a(y);
     static int geti(a temp)
          return temp.i;
enjoy .........
This is my first reply to forum .
If you found any problem free feel to tell
Thank you

Similar Messages

  • C7 how to access the PRIVATE folder in phone memor...

    C7-00 how to access the PRIVATE folder in phone memory?
    Meaning the folder C:\private
    With X-plore you can see the folder but it is marked as 0 kb.
    Edit: reason for this is that I had Angry Birds installed on memory C:
    Then I had changed my phones default game install memory to E: at the OVI store setup in the phone. On Monday OVI suggested that I should update the AB and so I did.
    Now it installed the new version to memory E: and all my game progress was gone.
    Just need to see if the save game still lays on C:\private\20030e51.
    Solved!
    Go to Solution.

    Ah, I'm sorry - I thought it was the private folder in C drive that I had managed to get into the previous week but it was the private folder in mass storage ...
    If you want to thank someone, just click on the blue star at the bottom of their post

  • How to access the private method

    All,
    I have class ABC with private method getfilename().
    I want to use this private method ...
    Is it possible to use this method without inheritence ?
    Is it possible to access this private method using annoymous inner class ?
    or any other alternatives ??
    namanc

    I have class ABC with private method getfilename().
    I want to use this private method ... You can't; it's private to the instantiations of that class.
    Is it possible to use this method without inheritence ? No, no even with inheritance.
    Is it possible to access this private method using
    annoymous inner class ? Nope, unless you can write that anonymous inner class yourself.
    or any other alternatives ?? Nope; privvy parts are privvy parts and only the owner of those privvy
    parts can touch them. (ahem)
    kind regards,
    Jos
    ps. unless you want to do reflection surgery of course.

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

  • How to access the archive folder in jive forums programiticaaly

    hi
    how to access the archive folder in jive forums programitically using weblogic 10.3
    Thanks
    Rani

    Ah, I'm sorry - I thought it was the private folder in C drive that I had managed to get into the previous week but it was the private folder in mass storage ...
    If you want to thank someone, just click on the blue star at the bottom of their post

  • In VB Programming code -- How to access the formula for suppressing a field

    In VB Programming code -- How to access the formula for suppressing a field
    I am using Crystal Reports 2008 v1
    Using VB code, I am attempting to modify a Crystal Report before exporting it into a PDF format and then displaying it on the Web.
    My problem is that I am unable to access the formula used to dynamically suppress a field.
    The following code is working:
    mySections = rd.ReportDefinition.Sections
    For Each mySection As CrystalDecisions.CrystalReports.Engine.Section In mySections
       ' myFieldToChange is a String set to the text of the field I need to adjust the Suppression
       iloop = 0
       For Each RecObj As CrystalDecisions.CrystalReports.Engine.ReportObject In mySection.ReportObjects
               If mySection.ReportObjects.Item(iloop).Name.ToLower = myFieldToChange Then
                   myTextObject = CType(mySection.ReportObjects.Item(iloop), CrystalDecisions.CrystalReports.Engine.TextObject)
                   myTextObject.Text = "new field text goes here"
                   mySection.SectionFormat.EnableSuppress = True
                   '  Here is where I want to change the formula for the Suppression
                End if
                iloop = iloop + 1
        Next
    Next
    I can not find any reference to the actual suppression formula in the SDK help file.
    Note, the EnableSuppress can be set to True for False, but if there is a formula for dynamic suppression, the True or False value is overwritten.  The results of the formula determine the suppression.
    Is there a way to reference this formula.  I know that I can put on in using the Crystal Report Designer software, I need to modify this formula using VB code and the SDK.

    Hello, Mark;
    If you are using the ReportDocument object you do not have access to the Conditional Suppression formula. You can get around it by using a formula field in the report for the supression and then using the FormulaField code to change it at runtime.
    If you want to change the supression condition directly at runtime you need to use RAS and the ReportClientDocument.
    Elaine

  • How to access the photos on icloud

    hi
    how to access the photos which i saved in i cloud, from my iPhone 5,
    Note: i do not use any PC. and i only have purchased 20 GB of space on an annual sub. so as to save my photos, and create space in my phone and now i am unable to access it,
    please advise
    thanks
    xxv

    There isn't really a way to "save" photos to iCloud currently with non-beta software.
    iCloud is involved with photos in 2 ways -- backup and Photo Stream.
    Backup of an iOS device includes Camera Roll photos but they cannot be viewed at iCloud.com -- the backup can only be used when doing a restore of an iOS device.
    Photo Stream photos also cannot be viewed at iCloud.com; Photo Stream is designed as a method of transferring photos from one device to another and is not designed to store the photos. More info http://support.apple.com/kb/HT4486
    There is a new feature -- "iCloud Photo Library" -- coming sometime after the iOS 8 release next week: http://www.macrumors.com/2014/09/12/apple-demotes-icloud-photo-library-beta/

  • I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files?

    I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files? Does using time machine mean that that partition is no longer able to be used as it used to be?
    HDD is a Toshiba 1TB, partitioned into two 500GB partitions.
    OS X version 10.9.2

    Yes, sharing a TM disk is a bad idea, and disks are cheap enough so that you don't need to.
    Now
    Have you tried to repair the disk yet

  • How to access the global data in user exit.

    Hi All,
    How to access the global data in user exit.
    the question is that when we were writing a code in the FM. i need to read data from the standard program like newly created documen and this document number need to be accessed in my program.
    this document number is not imported to the FM i needed to access for frther proceed.
    Thanks in advance.

    Hi,
    See the below PDF file by Jeff Goldstein. There you can find all the details about accessing data outside of the exit.
    [SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
    This will help you to solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Dec 2, 2008 4:18 PM

  • I have 2 game centers on 1 Apple ID and it willl only access 1 of them may someone tell me how to access the other one

    I have 2 game centers on 1 Apple ID and it will only access 1 of them may someone tell me how to access the other one

    You don't have to use the same ID for iCloud as you do for purchasing.  You can just set up iCloud using your other ID. 
    If your have already have another account, you have to go to Settings>iCloud, tap Delete Account, choose Keep on My iDevice when prompted, set up your new account with the other ID, turn on your iCloud data syncing and when prompted, choose Merge to upload your data to the new account.

  • Security.Cryptography - The specified path is invalid. while accessing the private key stored in LocalMachine store

    Hello,
    I have C# dll which is invoked through a C++ cgi executable which is deployed on apache 2.2. I am getting the following error when I am trying to access the private key of a certificate which is stored in the Localmachine store. It works fine while
    debugging in visual studio.
    It also works fine when I try to access the same certificate from the current user store through apache.
    I have tried running apache as "SYSTEM", even then I get the same error.
    I have followed the right process to import the certificate into the localmachine store through mmc. 
    Error Message:
    The specified path is invalid.
     caused by mscorlib
       at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
       at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
       at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
       at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
       at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
       at SamlImplLib.SamlImpl.GetSamlResponse(String sInParamXml, String sInAttrXml)
    The above error is not really helpful as it doesnt tell me which path is invalid as I am not passing any path in my code. I am just accessing the certificate through the X509Certificate2 store
    Thanks in advance

    Hi,
    This is probably because the worker process identity does not have read permission to the machine key store.
    And I agree with you. "The specified path is invalid" is a typical misleading message.
    You may need to clarify the difference between "SYSTEM- User" and "Current-user "through apache. Good Luck!
    Best regards,
    Kristin
    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.

  • Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Did you have the phone set to backup things to the One Drive on Microsoft servers?

  • How to access the webservice in portal component

    hai
         how to access the webservice in portal component.
         anyone knows give the solution
    Rds
    Shanthakumar

    Hai
    Please check this link.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/connectivity&
    Regards

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

  • How to access the value of application item in javascript

    How to access the value of application item in javascript?

    Hi,
    One way
    var myVariable = '&MY_APP_ITEM.';Br,Jari

Maybe you are looking for

  • Cleared items on 31.05.11 is shown in the report S_ALR_87013344(GR55, 8A99)

    Hi The user has cleared the vendor account on 31.05.2011 but when he executes the transaction code S_ALR_87013344 vendor open items for profit center he still sees on the 31.05.2011 in this report. That means it is open item on profit center. But in

  • Wht is the tcode to include and report on the sap main screen?

    Hi all, What is the Tcode to include any program on sap main screen? like when we logon to the sap, it will display abap editor, etc.... i want to include one more item there, can anybody let me know how to do that? thanks

  • How do you set up email on the iPhone?

    Updated my iPhone from a 4 to a 4S. I restored from back up but now having a problem with my email where I can receive emails but can't send. When I attempt to send, I get the message "Cannot Send Mail  - The user name or password for "SMTP:(my email

  • Enter login manager and X respawn issue

    Wondering if anyone else has this. I have a login for myself and one for my wife and 'normal' people who don't want/know how to use a tiling WM and firefox-pentadacytl, and want to have a graphical login manager. SLiM caused too many hard crashes whe

  • Why do some computers join OD and have a dollar sign ($) appended to the name?

    This question has been asked before here a few times with nobody being able to really definitively answer it (see: 2027636, 5979187, and 11144245).  It has been a couple of years and versions of OS X server and I am running into this same issue.  I a