When it's required to share a single object in different classes????

Hi friends...
I am new to java programming language....
when it is required to share a single object in different classes???
and
please give me one example with explanation...
Thank you
regards Shree

sun_shree wrote:
Thanks for all giving reply.....
please write the constructor which is accepting reference and please,,,,,, explain......
Thanking youNo.
This will be covered in any Java textbook or tutorial. Like this one: [http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html]
After reading it and writing some code of your own to test your understanding, if you still have a specific question, post again.

Similar Messages

  • I am getting this error message when i try to open FF "ug-in object: TypeError: Components.classes[cid] is undefined"

    This is the error message I get when i click to open FF after i downloaded the newest version: "ug-in object: TypeError: Components.classes[cid] is undefined" . The message is in the top left corner and not fully visible. i sent a message a few min ago so i am sending this b/c i copied the error message to help diagnose the problem.

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Can I share Attributes/Variables between 2 different Class Driver Sessions?

    I am designing a Simulator of Instrumentation following these steps:
    1) re-programming, re-compiling, and re-building the DLLs from the advanced class simulation drivers included in IVI Driver Toolset 2.0 using LabWindows/CVI 7.0;
    2) then i create a VI in LabVIEW 7.0 which calls an IVI Class Driver obtaining the desired simulated output data.
    My problem is that I need to share variables between different DLLs in LabVIEW.
    I want to simulate a circuit which consists of a battery and a resistor. I've got 2 instruments: a DC Power Supply and a Digital Multimeter.
    The DC Power Supply acts as the battery providing a certain voltage level, and the Multimeter measures the Voltage and the Current in the resistor.
    I've designed a VI in LabVIEW which uses 2 different sessions: one which calls the class driver IviDCPwr, and the other one which calls IviDmm.
    I wish to be able to access the attributes from "nisDCPwr.c" in the file "nisDmm.c".
    For example, to write a line like this:
    Ivi_GetAttributeViReal64 (ViSession vi, ViConstString channelName, NISDCPWR_ATTR_MEASUREMENT_BASEV, 0, &reading));
    inside the source code "nisDmm.c" of the advanced class simulation driver.
    The problem is that the only ViSession accessible from nisDmm is the handle from the Digital Multimeter, but not from DC Power Supply.
    Would this be possible? Is it "legal"?
    I've tried another approach through the declaration of external variables, but unfortunately I get a run-time error in LabVIEW.
    The only solution I've found is using auxiliary files going between, through the functions included in the Low Level I/O Library .
    Nevertheless, the solution proposed above would result much more convenient, faster and safer in my application.
    I hope everyone has understood my question, and anyone can help.
    THANK YOU VERY MUCH FOR YOUR TIME!!!

    Doesn't anyone have an answer?
    Or any proposal?
    Or even a clue?
    THANKS!

  • Generally, when is mutex required?

    I am using the VI Server to launch multiple, identical .vit's in top level subpanels. It seems to be working fine.
    However, I have been reading up on re-entrancy, Semaphores, LabView threading, etc. and am now adequately petrified there is a potential for disaster here if I am not careful.
    Are there some simple guidelines for when to protect shared objects from concurrent access and when not to worry about it? It gets confusing when multiple identical VI's are running. I have not made them re-entrant, but they are obviously running concurrently. I am guessing that since they were created from a .vit they are technically differently named VIs, right? What surprises me is that a common sub-VIs called by the .vits also runs concur
    rently...... and this is a normal VI (not re-entrant).
    I gather from reading that in some cases (such as when a DLL call is involved) that some inherent protection is provided and I do not have to worry about it. Do I need to open the diagrams of all subvi's called in order to assess this threat or not?
    Other cases (such as a VI that Reads-Modifies-Writes a global variable) concern me. In this specific case, the ReadModWrite.vi is called as a sub-vi from the vit's -- do I need to be concerned with protecting the global with a mutex (semaphore)? How about if the read/mod/write were separated into 3 different sub-VIs (hypothetically)?
    If I make sure that anything "critical"(Globals R/Mod/W, GPIB Write/Query, etc) is accessed from a VI that is non-reentrant, then does that solve the problem?
    I apologize for the shotgun question, but this issue really does affect many aspects of LabView.

    Great question Mike!
    A mutex is required when ever you have a data structure that can be modified by more than one entity.
    That is the short answer.
    These mutexes do not have to be explicit! LV uses mutexes "behind the scenes" to ensure non-re-entrant VI's are not executing at the same time.
    So if I understand your "such as a VI that Reads-Modifies-Writes a global variable" as a VI that shared by all of your VIT's that is the one and only method used to modify the global, then your global data is being protected by the mutex that protect the VI!
    This is one of the benefits that come along with the "functional global".
    RE: the dll calls.
    The call library function will default to the user interface thread. The user interfacte thread is single threaded so this ensures there is only one call to to the dll at a time. If you re-configure the nodes then this does not apply.
    You can combine the two above thoughts to be able to run a dll in a thread other than the user interface and still ensure only one call at a time. You put the dll call in a non-re-entrant VI. This will harness that same feature to ensure the is only one caller of the dll while allowing it to run in a thread other than the user interface.
    So...
    Most of the time I can get away without using mutexes (mutexi?) becuase I make extensive use of functional globals.
    Now let me share how I architect LV app's and convince myself that I do run into the issues you have raised.
    LV uses the data flow paradym so I design my aap's around the data, rather than around the process.
    I will start defining my data objects based on the app's requirements.
    These data objects can be globals, files, registers, GUI objects, etc. When I have the ability to define these objects (i.e. I can not define device status and control register formats) I will use techniques similar to what is used in DB design, keeping data grouped logicly while keeping LV performance in mind as I go (i.e. If I know I will be accessing an array of clusters based on one of the elements, I will copy that element off to a seperate array to facilitate quick searches, like a "key").
    Once I have the data structures defined, I will then go through and design the code that will provide the functionality I need and take carefull note of who write the data objects and when.
    It is durring this phase of the design that alarms will go off when I see that data needs to be modified from more than one place.
    Each of the alarms are dealt with in turn and the conflicts are handled using the tools that come with LV (LV2 globals, queues, semaphores, etc).
    So by the time I start coding I already know where my conflicts are and have plans in place to handle each.
    I would be interested in hearing how others approach design.
    LV is a unique dev environment that requires design techniques that are unique from other environments.
    I hope this answers your question.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Share a Single user profile between machines? more one user sign in?

    Is they any reason why this would be bad beside all setting and my docment profile etc be the same folder or would it be ie supported better to create profile for every machine login?   they will only be run one program
    Andy A

    You used to be able to create a mandatory profile, which would essentially be a profile per person but locked so it cannot be edited.
    I don't believe you can share a single profile between multiple people ie (one c:\users\ folder).
    http://technet.microsoft.com/en-us/library/gg241183(v=ws.10).aspx
    Robert Pearman SBS MVP
    itauthority.co.uk |
    Title(Required)
    Facebook |
    Twitter |
    Linked in |
    Google+

  • Crashes when running applications from network share - "Windows cannot access the file for one of the following reasons"

    Hi,
    starting a couple of weeks ago, we get the following error(s) when running applications from a network share. We don't know what causes this, we are not aware of any major changes in our network infrastructure or client/Server configuration. We did upgrade
    a lot of machines to Windows 8, but the issue also occurs on older Win7 computers.
    We figured out a workaround though: The applications run fine when launching from a FQDN share (like
    \\share.domain.Company.com) and only cause problems when running from
    \\share directly. They have worked fine for years without FQDN though.
    Any ideas?
    Error Details (the Kind of error differs greatly):
    # 1 #
    Log Name: Application
    Source: Application Error
    Date: ...
    Event ID: 1005
    Task Category: (100)
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: vmDEV
    Description:
    Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program XYZ
    because of this error.
    Program: XYZ
    File:
    The error value is listed in the Additional Data section.
    User Action
    1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
    2. If the file still cannot be accessed and
    - It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be contacted.
    - It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
    3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.
    4. If the problem persists, restore the file from a backup copy.
    5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for further assistance.
    Additional data
    Error value: C000020C [ also seen with code C00000C4]
    #2 (German error Messages from now on, we only use German OSes, the above english one is translated based on similar error Messages I found on the web) #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea67c3
    Name des fehlerhaften Moduls: clr.dll, Version: 4.0.30319.34014, Zeitstempel: 0x52e0b784
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x00026549
    ID des fehlerhaften Prozesses: 0x13ac
    Startzeit der fehlerhaften Anwendung: 0x01d055a854d36445
    Pfad der fehlerhaften Anwendung: \\share\application.exe
    Pfad des fehlerhaften Moduls: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Berichtskennung: 949ea933-c19b-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    Anwendung: XYZ.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: Ausnahmecode c0000006, Ausnahmeadresse 720B6549
    Stapel:
    # 3 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei SP.Forms.AutoCompleteSelectionBase.OnEnter(System.EventArgs)
       bei System.Windows.Forms.Control.NotifyEnter()
       bei System.Windows.Forms.ContainerControl.UpdateFocusedControl()
    # 4 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.IO.UnmanagedMemoryStream.ReadByte()
       bei System.IO.BinaryReader.ReadByte()
       bei System.IO.BinaryReader.Read7BitEncodedInt()
       bei System.Resources.ResourceReader._LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObject(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean)
       bei System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean)
       bei System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo)
    # 5 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.Reflection.RuntimeParameterInfo.get_Name()
       bei System.Diagnostics.StackTrace.ToString(TraceFormat)
       bei System.Environment.GetStackTrace(System.Exception, Boolean)
       bei System.Exception.GetStackTrace(Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString()
    # 6 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea834f
    Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 6.3.9600.17278, Zeitstempel: 0x53eeb460
    Ausnahmecode: 0xe0434352
    Fehleroffset: 0x00012f71
    ID des fehlerhaften Prozesses: 0xa68
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb7ec4ed6
    Pfad der fehlerhaften Anwendung: \\share\XYZ.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
    Berichtskennung: 010514d0-c190-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    # 7 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea7a6e
    Name des fehlerhaften Moduls: ntdll.dll, Version: 6.3.9600.17630, Zeitstempel: 0x54b0d74f
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x0006db27
    ID des fehlerhaften Prozesses: 0x18dc
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb08529c3
    Pfad der fehlerhaften Anwendung: \\share\xyz.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\ntdll.dll
    Berichtskennung: ef389186-c18f-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:

    Hi,
    >>The applications run fine when launching from a FQDN share
    It sounds like a DNS suffix issue. When this issue occurs, please try to ping share on the client, then check if the corresponding IP address is correct. If the IP address is wrong, please adjust your settings of DNS to make sure that the client can resolve
    the share correctly.
    If it's very hard to change the settings of the DNS for some reason, as a work around, we can add the entry into the clients' hosts file.
    Best Regards.
    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • I am trying to share 3 iCloud calendars, but I do not see any options when I click on the Share icon.

    I have several calendars on my iCloud, and I want to share 3 of them with my wife. I am using Safari 6.0 on Mountain Lion (10.8), and when I go to my calendars on iCloud, I see all of the calendars listed in the left column. The three I want to share already have an active Share icon (green), although I do not recall sharing these calendars in the past.
    When I click on the Share icon beside each Calendar, it shows that the calendar is shared with myself. There is NO OPTION in this window for unsharing, or adding my wife to the share, or making them a Public or Private Calendar. The only option is a check box that allows me to decide whether to receive emails alerts when something is changed.
    I currently see all of my iCloud Calendars on my iPhone, iPad, and Mac Powerbook (running Mountain Lion). I share them with no one else. I have three Calendars that I do not want to share, and they have the options described in the Online Support, but the three I want to share with her give me NO OPTIONS.

    I should clarify that I am using a MacBook Pro, not Powerbook (if that's the proper nomenclature).

  • Why do I get the "iwork discontinued" message when I click on the share feature in pages?

    Why do I get the "iwork discontinued" message when I click on the share feature in pages?

    If you are using an older version of iWorks, the sharing was, I understand discontinued in July 2012.
    New versions of the iWorks suite, Pages etc now have the sharing option, introduced earlier this year.

  • ITunes:  How can multiple accounts on one iMac share a single iTunes library?

    I have a single iMac with multiple user accounts.  How can I share a single itunes music library with all users?
    Thanks for your input!!

    how to share music between different accounts on a single computer

  • Files (fonts) appear as Unix files when viewing on an SMB share

    We have a UNIX server running Linux which our Mac users are connecting via SMB.  We moved our company fonts to this server from an OSX Server.  All of our machines are running 10.6.6 or later.  Very intermittantly without any rhyne or reason some users when they mount the Font share, the Fonts show up as Unix files rather than the Fonts.  On my machine (10.7) they all appear normally.  Now I know that SMB was revamped in Lion so this may be the reason I can see them no problem.  But the 10.6 machines, any suggestions on fixing this?

    Any solution on this issue? I have nearly the same exact issue in my environment, but is reversed.
    The problem we have is when saving files to the server from the Snow Leopard machine, the older Tiger machines see the fonts as unix executable files. The snow leopard machine sees the files fine and can open everything with no problem.
    This only happens when saving to a SMB server, as I can save the files from Snow Leopard to a flash drive and open on Tiger with no problems. Additionaly files saved from Tiger to the server are perfectly fine when accessing from Tiger or Snow Leopard.
    We're running Windows 2008 Server and connecting via the macs using the SMB method. Also duplicated the issue on a Windows 2003 Server.

  • When I try to Home-Share It works most of the time. It will always show up, but sometimes I tap on the icon of my library then it wont load, I restart my computer, IOS Divice and my router It still wont load my Library .... WHY!

    When I try to Home-Share It works most of the time. It will always show up, but sometimes I tap on the icon of my library then it wont load, I restart my computer, IOS Divice and my router It still wont load my library. I even went and tried to reinstall Itunes and everything nothing works.

    Hi,
    /Users/sarahschadek/Desktop/Safari.app/Contents/MacOS/Safari
    Move the Safari app from the Desktop to the Applications folder.
    Restart your Mac.
    That's why you see this:
    When I try to do the updates my computer says it has ready it goes through like it is downloading them then at the end it says some of the files could not be saved to "/" files.
    After your restart your Mac, click the Apple  menu (top left in your screen) then click:  Software Update ...
    Carolyn  

  • Strange white light appearing when password input required on locked apps!

    Strange white light appearing when password input required on specific apps... Locked apps.
    It is a thick white line) appearing momentarily on upper left side of my screen.
    This only appears briefly as specific apps are opening up .....only on apps where a password is required,(locked apps) like password managers, Apple App Store, etc.
    (this is a little troubling… And I'm wondering about the security of my phone now)
    I'm using iPhone 5s with latest iOS 7.1 This only started after the latest iOS update!
    Although this line appears very briefly, I was able to get some screenshots examples (see links)
    [IMG]http://i58.tinypic.com/1zo9dt1.jpg[/IMG]
    [IMG]http://i61.tinypic.com/260bns8.jpg[/IMG]
    Apple has no idea what this is… They're only suggestion was to wipe the phone clean and reinstall from the last backup! If that doesn't work, they would replace the phone.
    Before I have to do this, I'm wondering if this could be a phone app doing this, or the iOS or something easily explained/ remedied?
    Any ideas?

    Anyone have any thoughts on this? Searches and experiments
    still not yielded an answer...

  • Color space-creating a book in My publisher-.when I look at the share book pre print the colors are all dulled out. I work in pro photo rgb in LR and PS -.My Pub is sRGB-.where is the problem?

    Color space…creating a book in My publisher….when I look at the share book pre print the colors are all dulled out. I work in pro photo rgb in LR and PS ….My Pub is sRGB….where is the problem?

    I finally got to my references. This had to do with "soft proofing" on screen in Photoshop.
    So this may not help you at all. Re: Strange sRGB soft-proofing behavior  So go ahead and leave that setting at Basic.
    However there is a Color Management forum that you also go to and see if anyone has answers for your particular problem.
    Here is the link: Color management
    I hope they can help you out.
    Gene

  • How many domains can share a single set of database repository schemas?

    How many domains can share a single set of database repository schemas (created by the RCU)?
    What is the best practice in an environment with many domains/WLS servers/applications and a desire to manage minimum database MW repository schemas?

    Hi,
    You can't share the same repository for multiple domains.
    http://docs.oracle.com/cd/E23943_01/web.1111/e13716/understand_domains.htm#i1102627
    (Please mark question as answered or helpful)
    Arik

  • Some snaps show up as black screens when I try to view them as single pictures.Even when I run them in slideshows they show up as black screens.These are jpeg files.How can I avoid this happening?

    Some snaps show up as black screens when I try to view them as single pictures.Even when I run them in slideshows they show up as black screens.These are jpeg files.How can I avoid this happening?

    There are several possible causes for the Black Screen issue
    1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
    2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help:
    As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

Maybe you are looking for