Please tell how to do this.

Hello,
Below there is a small code snippet.
What I want is irrespective of how many times I am calling the TestSerialize.getTest()
method the object of Test which I am getting should be always the same.
And the object, which I get, should be serialized.
Note that the Test class I can not change since that I am getting from some third party.
So please suggest what code should I write in TestSerialize class.
Looking for your answers.
Thanks and Regards,
Sachin Dare.
import java.io.Serializable;
class Test{
public static Test getTest(){
return new Test();
class TestSerialize implements Serializable{
static Test obj;
public static Test getTest(){
obj = Test.getTest();
return obj;
//To do here something
class OtherClass{
public static void main(String[] args){
Test t = TestSerialize.getTest();
Test t1 = TestSerialize.getTest();
if(t==t1)
System.out.println("Objects are same....");
else
System.out.println("Objects are different....");

What I want is irrespective of how many times I am calling the TestSerialize.getTest()
method the object of Test which I am getting should be always the same. if (obj == null) {obj = Test.getTest();
return obj;> And the object, which I get, should be serialized.Now that's a little harder...

Similar Messages

  • My sons ipod touch apps will not load. you touch them the title screen for the game flicks up then dissappears. Could someone please tell how to fix this or what could be wrong?

    My sons ipod touch apps and games will not play. when you touch to game to load it the title screen flicks up and then disappears. please could someone help me to fix this problem or tell me what could be wrong?

    I would first try resetting your iPod. Nothing will be lost.
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.

  • How to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    how to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    my problem solve by me
    first create apple id
    fill credit card details
    and complete your account creating  process.
    than go to app store or itune store
    login your acount
    click right side  - account button
    than again login for account setting
    next go to payment information and click edit button
    when u enter payment infomation
    click none button in payment method and click done button.
    than ur credit card has been removed.
    but rs. 60 will deducted in your account when u doing this process.

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • TS2634 I bought a composite AV cable with 30 pin connector at a proper apple store for my ipad 2 which no longer works now i have updated to ios7 - please advise how to make this work ?

    I bought a composite AV cable with 30 pin connector at a proper apple store for my ipad 2 which no longer works now i have updated to ios7 - please advise how to make this work ?

    I have the same problem.
    Two similar discussions:
    https://discussions.apple.com/message/23081658#23081658
    https://discussions.apple.com/message/23281391#23281391
    I have not yet seen any official response to the question: "Is the Apple AV Composite cable fully supported with 30pin connector devices upgraded with iOS7 - specifically ? - eg. iPad 2, iPhone 4, iPhone 4s"
    If it is not currently supported is that then due to a bug / oversight and in that case is it something that will be fixed in the near future?
    Please let us know what feedback you got from asking Apple support.

  • Hello I have encounted a problem with Photoshop. Normally when you start a new documant, you are given the options to have A4, A3, ect page set ups. These inbuilt page set ups seem to have disapeared, does anyone please know how to fix this? Many thanks

    Hello I have encounted a problem with Photoshop. Normally when you start a new documant, you are given the options to have A4, A3, ect page set ups. These inbuilt page set ups seem to have disapeared, does anyone please know how to fix this? Many thanks Ben  [email protected]

    Hello Trevor
    Thanks for your message. You can custom set pages but there are no preset of page sizes like A4, A3, ect. I cannot click the size preference, nothing comes up
    Ben

  • TS2370 My iPhone detects my my Belkin G5 series wifi router but not connecting, I searched in internet and found many people have similar experience. Please tell , how can I fix it?.

    My iPhone detects my my Belkin G5 series wifi router but not connecting, I searched in internet and found many people have similar experience. Please tell , how can I fix it?.

    Try rebooting the router. Just remove the power for a few seconds. No settings are lost.

  • Please tell how to do, that when I want to forward a message, a message opens in new tab, not in a new message window in thunderbird. Thanks.

    Please tell how to do, that when I want to forward a message, a message opens in new tab, not in a new message window in thunderbird. Thanks.

    Sorry, but at the moment 'Compose in a tab' isn't yet possible. You'll always get a new windows when composing or replying/forwarding a message.

  • Hello, iam using the latest version of firefox, whenever i login into my yahoo mail account i get a stop script error, the details of the error script is mentioned below , please suggest how to stop this : STOP ERROR

    Hello, iam using the latest version of firefox, whenever i login into my yahoo mail account i get a stop script error, the details of the error script is mentioned below , please suggest how to stop this
    the website is www.mail.yahoo.com. i was getting the same STOP script error every now and then in firefox 6 as well

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

  • TA48312 please tell how to downgrade from ios6.0.1 to ios5.1.1,

    please tell how to downgrade from ios6.0.1 to ios5.1.1,.
    there are many problems with ios6 in my iphone 3gs. like map not working at all, slow performance, app centre got verry slow, youtube taken away, in short over all bad experiance with iios 6 as compared to ios5.
    so please tell me how to downgrade... or remove above short coming by realsing new version of ios.
    thanks
    Rajesh Tarpara
    <Edited by Host>

    Please See item 3 Here  >  Community etiquette

  • Since i changed to Firefox 4, now I no longer can view the lower portion of my screen which reveals the LOCK security feature. Please advise how to fix this?

    Since i changed to Firefox 4, now i can no longer view the lower portion of my screen which reveals the LOCK security feature. Please advise how to fix this? if I don't hear back today, i will have to undo Firefox 4 completely

    the lock symbol has been removed in Firefox 4 and replaced with the [[Site Identity button]]
    You can get the padlock back by installing this add-on: https://addons.mozilla.org/en-US/firefox/addon/padlock-icon/?src=discovery-learnmore
    To reinstate the status bar at the foot of the page (also removed in Firefox 4), install this add-on: https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/

  • HT4859 I lost my contacts on outlook and now I have contacts only on icloud of iPhone 4 please tell how i can restore my contacts from icloud to my contact list in iPhone and to my outlook

    I lost my contacts on outlook and now I have contacts only on icloud of iPhone 4 please tell how i can restore my contacts from icloud to my contact list in iPhone and to my outlook

    Welcome to the Apple Community.
    Use your back up on your mac/PC and re-add your contacts to Address Book or whatever contact software you use.

  • Hi my iPad displays "iPad disabled connect to iTunes" when I connect it to iTunes it keeps asking for me to enter password but I can't because the iPad is disabled. Please advice how to resolve this problem. Thanks   Best regards iPad 2, iOS 6.0.1

    Hi my iPad displays "iPad disabled connect to iTunes" when I connect it to iTunes it keeps asking for me to enter password but I can't because the iPad is disabled. Can anyone please advice how to resolve this problem. Thanks
    Best regards
    iPad 2, iOS 6.0.1

    You may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad and restore/resync your content to it

  • PLEASE TELL HOW TO UPDATE OS X MAVERICKS I AM RUNNING 10.6.8

    PLEASE TELL HOW TO UPDATE OS X MAVERICKS I AM RUNNING 10.6.8 and i am installing OS X MAVERICKS

    Mac App store. download.
    >Software update

  • HT1420 my pc is not accessing the itunes its just saying.... "accessing itunes..........." thats it  !!! can u please tell how it will work !!

    guyz can u please tell me how can i access the itune store on my lappy. when i connect that thing start saying/displaying that its accessing itunes............
    thats it !!!!!!!!
    its not accessing for hours !!!! why it is happing i want to authorise my computer so that i can transfer my purcheses !!

    I had the same thing happen. I hooked my iPod up to my notebook, which has iTunes and is set up for my daughter's iPod 30GB Video. I have the old clickwheel 20 GB. Mine is set up to use my desktop computer. I thought it would not harm it to just charge it on my notebook as long as the notebood was turned off. Then when connecting to desktop, I got the do not disconnect sign..I ended up rebooting the computer and ended up with the sad iPod face. I have reset so many times and cannot restore iPod. I have charged it numerous times with the wall outlet. When connected to the desktop, it just shows the Apple icon. I have reinstalled iTunes. Please let me know if you find an answer to this problem. Best of luck to us both.
    Anyone who can help us please do so.
    Thank you!
      Windows XP  

Maybe you are looking for

  • Windows 8.1 dual boot after image

    Hey guys I'm having a little weird thingy with my dual boot systems at work... I've been Google-ing a while, but can't find anything about it. Allow me to explain. I have a classroom with 16 computers running Windows 7 Professional. Because a course

  • Why does the FP 10 work with firefox but not with IE8

    I down loaded the folowing for xp FP uninstall, FP plugin and FP debug from the link in one of your replys. now I can watch youtube  with firefox but not with IE8. you asked me before if i was using 16 bit. whats that mean and how do I find out? plea

  • Just got "Could not complete your request because of a program error"

    I tried opening a clients TIF file about 30 minutes ago and after it opened in Photoshop, I got a box that says "Could not complete your request because of a program error" I hit OK and it pops back up. Over and over and over and over. I shut down ev

  • Schedule Report to WEBDAV location. Problem with webclient service

    Hi! I am having difficulties scheduling a report to a webdav location (Which is sharepoint). It had been working for about two weeks. My BO environment and the sharepoint location are on two different domains. I have been running webclient service in

  • Prompted to Open or Save a pdf File

    Does any one know how this Works: What is the security difference between having Acrobat opening a PDF from a webpage inside the browser and opening in the Acrobat program. I ask because when i have Acrobat opening PDF's inside the browser it does no