Why trantient variables won't participate in serialization

why trantient variables won't participate in serialization?
Reason Plz.
Static variables are not an instance variables so they don't participate
In which places transient ,statics are used
Help me
Byeeee

why trantient variables won't participate in serialization?
Reason Plz.
Because the key word transient says that they are not supposed to be
serialized .
-Lets say you have a Timer as a part of the class then it shoud be
declared as transient as Timer state need not be preserved but its
a requirement that it starts a fresh evry time.

Similar Messages

  • Hi, I am wondering why my iphone won't send pictures through messages, I have MMS on and I have tried sending it with 3G on aswell and still doesn't work. Someone please help me :)

    Hi, I am wondering why my iphone won't send pictures through messages, I have MMS on and I have tried sending it with 3G on aswell and still doesn't work. Someone please help me :)

    Hey lozza567,
    Thanks for the question. I understand that you are experiencing issues sending MMS messages. The following resource may provide a solution:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Issues with sending and receiving MMS
    You will need these to send and receive MMS:
    - An iPhone 3G or later.
    - iOS 3.1 or later.
    - A cellular data connection. MMS isn't available if you are using only Wi-Fi.
    - A domestic MMS plan from your cellular provider. You may need an international messaging plan to send MMS to an international contact. Contact your carrier for more information.
    - A roaming MMS when using a cellular provider's network different from your billing cellular provider's network. Learn more about roaming and contact your carrier for more information.
    To resolve issues with sending and receiving MMS, follow these steps first
    1. Go to Settings and turn airplane mode off.
    2. Go to Settings > Messages and turn MMS Messaging on.
    3. Go to Settings > Cellular and turn Cellular Data on.
    4. Go to Settings > Cellular and turn Data Roaming on if you are roaming on a cellular provider network different from your billing provider's network.
    5. Verify that you have a cellular data connection in the status bar at the top left of your iPhone.
    6. Go to Settings and turn Wi-Fi off. Open Safari and navigate to www.apple.com to verify that you have a data connection. Turn Wi-Fi back on to continue using Wi-Fi for other features. If your cellular data connection isn't available, follow these steps.
    7. Verify that you can send and receive SMS. If you are unable to send and receive SMS, see the "Issues with sending and receiving SMS" section, above.
    8. MMS may not be available while on a call. Only 3G and faster GSM networks support simultaneous data and voice calls. Learn more about which network your phone supports.
    9. Restart your iPhone.
    10. Tap Settings > General > Reset > Reset Network Settings on your iPhone.
    11. Reseat your SIM card.
    If you are still unable to send or receive MMS, follow these steps
    1. Make sure that the contact trying to message you isn't blocked in Settings > Messages > Blocked.
    2. Go to Settings > Messages and turn on group messaging if you are sending a group message.
    3. Make sure that you are using the area code with the contact's phone number. When sending messages internationally, you also need the contact's international code.
    4. Verify a "Pay as you go" MMS plan has enough available balance. Contact your carrier if unsure of your MMS plan or available balance.
    5. If the issue occurs with a specific contact or contacts, back up or forward important messages and delete your current messaging threads with the contact. Create a new message to the contact and try again.
    6. If the issue occurs with a specific contact or contacts, delete and re-create the contact from the Contacts application. Create a new message to the newly created contact and try again.
    7. Back up and restore your iPhone as new.
    8. If your carrier has recently ported your phone number, the porting process may not be complete. Contact your carrier to confirm that the porting process is complete.
    9. Contact your carrier to verify that you are provisioned to send SMS and are in an area with cellular coverage.
    10. Contact your carrier to verify that there are no blocks or filters placed on your wireless account preventing you from sending SMS.
    11. Your carrier may require APN settings to be modified to use MMS. Learn more about when you should adjust APN settings.
    Thanks,
    Matt M.

  • I'm having trouble buying a season pass for The Americans. I have purchased passes to Justified for the past 4 years with no problem. Can't figure out why this purchase won't work.

    I'm having trouble buying a season pass for The Americans. I have purchased passes to Justified for the past 4 years with no problem. Can't figure out why this purchase won't work.

    What is the problem that you are having ? If you are getting an error message then what does it say ?

  • Any suggestions on why Live Cycle won't open any longer?

    Any suggestions on why Live Cycle won't open any longer?

    Thanks.
    Stacey E. Drayer, Chapter Executive Director
    Central Virginia Chapter - CAI
    P.O. Box 5118
    Midlothian, VA  23112
    Description: rgbCEN VIRGINIA_CLR

  • Is there any reason why my computer won't recognize my iphone

    is there any reason why my computer won't recognize my iphone?

    Have a look here
    iPhone, iPad, or iPod touch not appearing in iTunes
    From Here
    http://www.apple.com/support/itunes/devices/

  • HT3702 Can you help me. Why my account won't purchase.

    Why my account won't work while I want buy stuff in the game I purchase on my iPhone

    What happens when you try to buy things, do you get any messages ?

  • Why local variables are stored on stack?

    Hi,
    Can anyone tell why local variables are stored on stack and objects on heap?
    Thanks
    Neha

    paulcw wrote:
    I'm pretty sure that Java doesn't store any objects on the stack.I wouldn't be so sure if I were you.
    Why wouldn't Java be open to possible optimizations? It's definately faster to keep an object on the stack than letting it go through the garbage collector.
    In fact the Java compiler from Sun has had this optimization in the pipeline for a long time. I'm sure it's due "anytime soon" now.
    So it's wrong to say that objects are always stored on the heap. They can be store on the stack if it can be proved that their lifetime is limited to that of a method call. This requires the compiler to perform a so called "escape analysis" which has been in place for a long time in Sun compilers.
    If you want to learn more, Google for "escape analysis".

  • Why do JavaBean properties have to be serializable in iWS6?

    I'm just getting started on JSP in iWS6.<P>
    It seems that the data types of properties (e.g. the type returned by the getter) must be serializable types. or the bean just generates errors when used. (I was surpised that it was the properties, not the static variables that support them, that had to be serializable.)<P>
    I have 3 JSP books and none of them mention that restriction, though they do say that the whole bean should be serializable if you want to support persistence in clustering and similar environments (which I'm not using). The books give examples of using non-serializable types for properties, like into or double.<P>
    Why is iWS6 imposing this restriction (and not documenting it!)?

    these are user-to-user forums.
    do you have a problem that we can help you with?

  • Help! Don't know why this source won't compile!

    Hey guys, i'm new to the java scene. I just picked up a book about a week ago ("Sam's Teach Yourself Java 2") I'm on the 6th lesson of the book, learning about "Packages" (ie. java.awt).
    The book contains compilable source code on a disk that comes with the book.
    I'm stumped with the example i'm currently working on, and i've tried everything in my limited knowledge of java to solve the problem, but I can't. The example involves 2 seperate java text files.
    package org.cadenhead.ecommerce;
    import java.util.*;
    public class Item implements Comparable {
        private String id;
        private String name;
        private double retail;
        private int quantity;
        private double price;
        Item(String idIn, String nameIn, String retailIn, String quanIn) {
            id = idIn;
            name = nameIn;
            retail = Double.parseDouble(retailIn);
            quantity = Integer.parseInt(quanIn);
            if (quantity > 400)
                price = retail * .5D;
            else if (quantity > 200)
                price = retail * .6D;
            else
                price = retail * .7D;
            price = Math.floor( price * 100 + .5 ) / 100;
        public int compareTo(Object obj) {
            Item temp = (Item)obj;
            if (this.price < temp.price)
                return 1;
            else if (this.price > temp.price)
                return -1;
            return 0;
        public String getId() {
            return id;
        public String getName() {
            return name;
        public double getRetail() {
            return retail;
        public int getQuantity() {
            return quantity;
        public double getPrice() {
            return price;
    and this one..
    package org.cadenhead.ecommerce;
    import java.util.*;
    public class Storefront {
        private LinkedList catalog = new LinkedList();
        public void addItem(String id, String name, String price,
            String quant) {
            Item it = new Item(id, name, price, quant);
            catalog.add(it);
        public Item getItem(int i) {
            return (Item)catalog.get(i);
        public int getSize() {
            return catalog.size();
        public void sort() {
            Collections.sort(catalog);
    Now the example has to do with creating a package "org.cadenhead.ecommerce"
    So I placed both source files in a folder in what I believe is my classpath. (C:\program files\java\jdk1.5.0_05\ lib\org\cadenhead\ecommerce)
    The Item class compiles, but the Storefront won't. Every class i've made this far has had no problems compiling, and I doubt that there is an error in the code since it is straight from the book. When I try to compile, i get 4 errors, all of which look similar to this:
    Storefront.java:15: cannot find symbol
    symbol : class Item
    location : class.org.cadenhead.ecommerce.Storefront
    public Item getItem(int i) {
    ^
    Can anyone help me out and figure out what's wrong here? I'm really confused about why it doesn't seem to be able to find the Item class. I'm kind of stuck in the book since I can't figure this out and I wanted to make sure everything was configured right. I set the classpath in the "Enviroment Variables" folder (windows XP) to .;C:\Program Files\Java\jdk1.5.0_05\lib\tools.jar
    but to no avail...
    Thanks to anyone who reads my thread and helps me!!!

    You don't say what your folder structure is. The statement
    package org.cadenhead.ecommerceimplies that your classpath contains a folder
    org/cadenhead/ecommerceand that the class files reside in the ecommerce folder.
    "org" is relative, it is contained in one of the classpath folders.
    I created a project in Eclipse 3.1 name org.cadenhead. Created a package ecommerce. I cut and pasted your code into two java files in the ecommerce package. The only change I made was to change
    package org.cadenhead.ecommerceto
    package ecommerceCode compiles without error. So I think either your classpath does not contain org.cadenhead.ecommerce or the Item class is not in org.cadenhead.ecommerce.
    Good luck

  • Why private variables, while still can be accessed by accessor methods

    Agreed it is well defined way of encapsualtion. But i wonder how it works differently. can any one explain . We declare a varibale as private which can be accessed by accessor (set/get) methods which are usually public. so why dont we say vairbkles itself as Private ??
    Pls explain

    Not only that, but imagine the case where you have an api method, getTotal(). Your first iteratation you have something like:
    double gross;
    double net;
    double commission;
    so to get the total you may want gross - commission = net. Thus your method may look like:
    public double getTotal()
    return gross - commission;
    But later on, iteration 2 or so, you find out you need to account for taxes, so now you don't want to break the code, the result should be the same, the NET total. However, you now need to account for taxes:
    public double getTotal()
    return (gross - commission) + tax;
    Without breaking any code and all while maintaining the actual API definition, you have made a public accessor method provide more functionality. All code using the getTotal() method wont break nor has to be recompiled and even better it now takes into account tax.
    Now, there is one "sticky" issue in the above. Because the getTotal() makes direct use of "private" variables, you may not get the "right" tax. In other words, what if there is state and local tax that need to be added? You may have two variables:
    double localTax,stateTax;
    The problem is, do you want your method like this:
    public double getTotal()
    return (gross - commission) + localTax + stateTax;
    Or would it look (and possibly account for future updates) better like so:
    return (gross - commission) + getTax();
    The thing is, what if later on you have additional tax to handle? Sure, you can simply add it to the end, adding it, what ever. But by making a "helper" method of getTax(), you might have on iteration 2:
    private double getTax()
    return localTax + stateTax;
    and in iteration three, you may have:
    private double getTax()
    return localTax + stateTax + salesTax;
    Now, unless you are calling code in an intensive performance needy loop, making a couple of helper method calls won't hurt performance at all, and it will greatly enhance your code quality because you can easily change the implementation of the method(s) used, without affecting the API.

  • Why prefix variables names with a colon?

    PROCEDURE calc_avg_sales
    BEGIN
    :sales.avg := :sales.month1 / :sales.total;
    EXCEPTION WHEN ZERO_DIVIDE THEN
    :sales_avg := 0;
    RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS THEN NULL;
    END;
    Excerpt from Oracle PL/SQL Programming ISBN 0-596-00381-1 Pg. 106
    Why are the variable :sales.avg, :sales.month1, and, :sales.total not declared in the above snippet? Is it presumed that they have been? Why is a : (colon) placed in front of the variables?
    Why would you think that FORM_TRIGGER_FAILURE is raised rather than ZERO_DIVIDE?
    Within my production environment I have noticed that error messages are sometimes vague to the user and for the technical user, and, would like to make use of an error table which would help technical support troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally this would include details of the Java Exceptions raised (usually large stacks) within applications that form part of the software architecture. How would you go about using an error handling mechanism?
    Edited by: Jon80 on Jun 24, 2012 2:02 PM

    Hi,
    Jon80 wrote:
    PROCEDURE calc_avg_sales
    BEGIN
    :sales.avg := :sales.month1 / :sales.total;
    EXCEPTION WHEN ZERO DIVIDE THEN
    :sales_avg := 0;
    RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS THEN NULL;
    END;
    Excerpt from Oracle PL/SQL Programming ISBN 0-596-00381-1 Pg. 106
    Why are the variable :sales.avg, :sales.month1, and, :sales.total not declared in the above snippet? Is it presumed that they have been? Why is a : (colon) placed in front of the variables?Variables that start with a colon act like global variables; they can be defined in a larger scope. The colon helps the compiler identify them as not necessarily being defined in the unit being compiled.
    Why would you think that FORM_TRIGGER_FAILURE is raised rather than ZERO_DIVIDE?Actually, I would expect PLS-00103 Encountered the symbol "DIVIDE" when expecting one of the following ..., because you have a space (ZERO DIVIDE) instead of an underscore (ZERO_DIVIDE). Cut and paste actual code when posting here.
    If you correct that, then ZERO_DIVIDE is raised in the procedure. An EXCEPTION handler keeps some errors that occur at run-time from being reported to the caller. In this case, the EXCEPTION handler is saying "Don't report ZERO_DIVIDE as an error. Instead, do this ...". In this example, part of what it is doing instead is raising a different error, and that's the only error that is reported to the caller.
    By the way, "WHEN OTHERS THEN NULL" is almost always a very bad thing to say.
    Within my production environment I have noticed that error messages are sometimes vague to the user and for the technical user, and, would like to make use of an error table which would help technical support troubleshoot the cause of the error, without giving unnecessary details to the end user. Ideally this would include details of the Java Exceptions raised (usually large stacks) within applications that form part of the software architecture. How would you go about using an error handling mechanism?One thing Oracle often does is print short, vague error messages on the screen, but write long, detailed messages in trace files on the database server. Programmers are instructed to look for a trace file when they see certain error messages. You might do something similar. Instead of (or in addition to) writing trace files, you could insert rows into an error-logging table.

  • Why original music won't play (greyed out) ?

    I know this is a well covered issue with Apple, iTunes, iPhones/Pads/Pods... I'm reading tons of questions and different solutions about this problem.
    I had my share of this with purchased music as well as CD copied. My ecosystem is all Apple (Apple desktop, MacBook Pro, iPhones, iPads, Apple TV... My loyalty is (still) there as I have invested too much in iTunes purchases :-) ...
    But I also need to use all this ecosystem as a work tool and 2 times out of 3 (can't figure out why it works sometimes...), when I create music and need as a producer to test some mixes in my car or earbuds through an iPhone, I'm stucked with a file that remains greyed out on some devices, even though it will play on the computer where it was created.  The song title appear on my iPhone, and on MacBook Pro but remain greyed out.  No cloud image on this line that I could simply click to bring it on the device.
    No I have not unplugged anything.
    Yes I use sharing and I subscribe to iMatch which should make everything available everywhere...
    Even a forced sync (wired) won't fix it. And no I don't want to backup, reset, spend hours to this bug which appears to last forever from posts I am reading back to 2010 and probably earlier, which should have been fixed by Apple for long... As musician and producer, I am beside anything related to protecting IP, however, when I can't even access my own IP, there's something wrong... (So I am besides anyone who purchased music legally and faces the same issue !... )
    So, just in case someone has an explanation or suggestion (update) to this frustrating issue, I am asking this question again...
    Thanks,
    Rob

    A month and no one has a clue ?? ....
    I'm not alone on this one, c'mon guys !

  • Why is variable scope so vexing?!  Argh!

    Dear Friends
    I used to think that if I declared a variable at the top of
    the first frame of my main timeline (and outside of any function
    bodies) that it would basically be considered "global" and could be
    accessed at any further frame in the main timeline (and by any
    child of the main timeline via prefixing enough "parent."s) but
    this is apparently not the case (unless there's something funny
    with uints where their values go to 0 from one frame to the next.)
    Is there something I'm missing here? Why is it so hard to declare a
    variable that can be easily seen throughout the main timeline (and
    the rest of the app as well)?
    And speaking of children seeing their parent's variables,
    what is the easiest way to make a variable declared on the main
    timeline accessible inside of a child? I don't want to have to
    count ancestors and add "parent.parent.parent." etc. and "root."
    doesn't seem to work... What's the magic prefix? Isn't there also a
    way of setting a variable equal to "this" on the main timeline? I
    don't know how it works, really.
    More generally speaking, does anyone have a surefire tutorial
    on variable scoping? I've read Moock and pored over the Help manual
    and it all still feels a lot less intuitive than it ought to. How
    do I master this subject?!
    Thanks and Be Well,
    Graham

    graham - you're right in saying that a var on the main
    timeline can be considered 'global' even without the use of a
    '_global' keyword - and i remember in my early learning i
    definitely thought the same thing as you are now. It's really a
    matter of 'paths' as you mention, but one does need to 'point' to
    the main in order to retrieve the value via root or a series of
    parents - even when using class structures as is more common now
    under 3, one still needs to point at the correct scope to access a
    property.
    sometimes though, a var can be 'reset' ... what i mean by
    this is, say for instance you have declared a var on the first
    frame, the playhead then navigates to a different frame wherein the
    variable has been set to a different value, then at another time
    the playhead returns to frame one (because one has a navigation
    structure that does so) in this case the variable is 're-declared'
    and set back to the default value! this type of situation often
    occurs with a timeline based system.
    class properties on the other hand, cannot be reset in this
    manner, which is one of the many reasons why class based systems
    are better for complex programming. personally, now-a-days my
    programs so not usually contain anything on the main timeline, no
    code or assets, instead all operations are achieved through code,
    mainly within class files (as is the benefit of 3)
    I'm sorry i don't know of any tuts i could point you to, just
    stick with it - i think that over time it hierarchy structure and
    path scopes become second nature - and at the rate you seem to be
    advancing, it shouldn't take long ;)

  • Why aren't some classes (like Point2D) Serializable

    Why aren't Serializable so many of the classes of Java2D ? (I've seen some other users are complaining about this too). In 1.4 the situation remains the same. If there is a reason I wouldn't mind but I don't know it. Is this a mistake or is there a good reason about this ?

    Yes, Serializable classes can be convenient, but for potentially high-volume objects like Point2D the overhead of using standard serialization dissuades it's use.
    Personally, I never have cared for standard Java serialization -- it's bulky, slow, and sometimes unreliable. I prefer a scheme which favors speed and a low profile. I've written an XML serialization mechanism for Java which accomplishes both. And nearly every class I write that is serializable (using my method) also implements Externalizable making them standard Java serialization friendly. The read/write methods of Externalizable simply forward to my serialization interface methods e.g.,  public void readExternal( ObjectInput in ) throws IOException
        readXML( new XMLSerializer( in ) );
      public void writeExternal( ObjectOutput out ) throws IOException
        writeXML( new XMLSerializer( out ), this );
      }

  • Why my macbook won't download latest itunes?

    my mac book won't download latest itunes? why?

    Have you figured this out yet? I am having the sane trouble and can't get it to load either. I updated my older MacBookPro yesterday. I downloaded Leopard and then Lion.  I currently have iTunes 10. I have a brand new iPhone 4S 16G, and a brand new iPad 2 3g 64g.  I went with the 16g phone because I decided to use iCloud and not store all my songs and photos in the phone.  However, now I can't seem to get iTunes 10.5 so the iCloud is just an idea at this point. 
    When I use the upgrade to 10.5 link on Apple's home page, my screen flashes and says "Upload successful." then I go into About iTunes and see that I'm still 10.  There is no iCloud in my menu and I'm stuck.
    I'm a regular PC user and am trying to convert myself over to Mac once and for all. So I'm early in the learning curve on how this all works.

Maybe you are looking for

  • Preview, photo opened in it looks sharp and then soften 2 sec. later!

    Everytime I open up a photo in Preview it looks sharp for 2 sec and then it soften right infront of my very eyes. Ther same photo looks sharp and stay sharp when open in Photoshop. Is there a bug in Preview that came with OX10? Has anyone found the s

  • Setting Up Mobile Accounts to For Users Who Already Exist

    Hi there, I work for a company with about 10 Macs, all laptops, all are on 10.5. They have never had a server and have asked me to set one up for them. I am in the process of setting up a server here with a new copy of OS X Server 10.5. Here's my que

  • Question about the "goback" opterations in ALV GRID control.

    Hi everyone,   I have a little situation here:     in my ALV ,I deactive some of the standard toolbar functions  and  add one button of mine on the toolbar.  I leave 3 standard toolbar functions: insert a row ,delete a row and  go back. after I used

  • Have lost all images in Iphoto 9

    I now have IPhoto 9 showing white squares but no images. I have tried every fix I can find on Apple sites and nothing works. For one thing, My Iphoto library is not in pictures, it is only on hard drive. I have tried rebuilding, but says no images. T

  • Can't open Indesign after update

    I opened Updater and allowed updates to Indesign CS5, Bridge CS5, and Photoshop CS5.  I received this error message: Extend Script Toolkit 3.5.1 Update Installation failed. Error Code: U44M1P7 Now I cannot open any of my Indesign documents.  Also, I