Difference between transient & volatile

1.what is the difference between Package & Import statement in java?
2.what is transient?what is the utility of it?when it is used?
3.what is volatile?what is the utility of it?when it is used?
4.what is the difference between
String mystring="SUNJAVA";
AND
String mystring=new String("SUNJAVA");

All of the questions can be answered by a simple google search. They are all frequently asked, and have been answered many times.
Kaj

Similar Messages

  • Difference between volatile and atomic variables (util.concurrent.atomic)

    All,
    Can some one explain to me the difference between using
    volatile variables and atomic variables as incremental/decremental counters
    that is shared by multiple threads.
    when should I use volatile and when should I use atomic variables.

    angeshwar wrote:
    All,
    Can some one explain to me the difference between using
    volatile variables and atomic variables as incremental/decremental counters
    that is shared by multiple threads.
    when should I use volatile and when should I use atomic variables.
    x++ is not atomic for a volatile variable. You can have ten threads executing that concurrently and only get a increment of one when it should have been ten. This problem won't happen with AtomicWhatever.

  • What is the difference between access specifiers and access modifiers?

    what is the difference between access specifiers and access modifiers? are they same? if not what is the difference.

    Access Specifier are used to specifiy how the member variable ,methods or class to other classes.They are public ,private and protected.
    Access Modifier:
    1.Access
    2.Non Access
    Access:
    public ,private,protected and default.
    Non Access:
    abstract,final,native,static,synchronized,transient,volatile and strictfp

  • Difference between Serialization Vs Externalization

    hi can anyone tell me Difference between Serialization Vs Externalization

    Serialization is the process of converting an object into a sequence of bits so that it can be persisted on a storage medium (such as a file, or a memory buffer) or transmitted across a network connection link. This process of serializing an object is also called deflating or marshalling an object.
    The serialization mechanism has been added into the Java language for two reasons:
    (1) the JavaBeans mechanism uses serialization.
    (2) remote method invocation (RMI) allows you to automatically use objects located at another host in the network just like any local objects.
    In order to serialize an object, you need the output stream OutputStream, which must be put into the special serialization stream called ObjectOutputStream. After that, you only need to call the method writeObject() to serialize the object and send it to the output stream. . Classes ObjectInputStream and ObjectOutputStream, which respectively implement the ObjectInput and ObjectOutput interfaces, enable entire objects to be read from or written to a stream (possibly a file). To use serialization with files, we initialize ObjectInputStream and ObjectOutputStream objects with stream objects that read from and write to files—objects of classes FileInputStream and FileOutputStream, respectively
    Vinayworld class implements serializable interface.
    Other class would be
    In this code object of the vinayworld class is serialized into a file name vinay.txt
    Serialization is a Marker interface -Marker Interface is used by java runtime engine (JVM) to identify the class for special processing.
    Use serialization when you need to add data to the serialization stream that is not an object data member.
    Externalization is same as Sterilization except that WriteObject() and ReadObject() method are called by JVM during sterilization an desterilization of object. One thing you can do with Externalization is that you can store extra information into object like STATIC variables and transient variables or you can add more information if you have any business need. One good example is compressing and uncompressing of data to send it through network or converting one format to other like a BMP image to JPEG or GIF format.
    Externalization allows you to customize how serialization is done. By implementing externalization you are controlling what gets serialized ( and what doesnot ) as versus default serialization where all non-transient attributes get serialized.
    For “fat data” classes with a large number of attributes only a few of which needs to persisted, externalization will help you reduce the size of serialized stream and the time taken to serialize the object. But there will be an overhead involved because the runtime has to call your methods to read/write objects.
    Read more: http://www.techartifact.com/blogs/2009/06/serialization-vs-externalization.html#ixzz2mWAYCMRz

  • What is the difference between Genius Mix and Genius Playlist?

    Yeah, what is actually the difference between Genius Mix and Genius Playlist?
    G.P. starts with a song I select and teams up with songs that go with it while G.M. is only songs that go well together, is that it?
    A G.P. that I like can be saved and altered, but G.M.´s seems to be volatile? Can I see all the songs in a G.M.? All I can find, is the possibility to click Next and Previous.
    Thanks

    Genius Mixes are 'Genre' based groups of music.
    Genius Playlists are songs that go together based on other people's playlists, they can be from any Genre.
    You can't see what will be playing in the Genius Mix list.
    Message was edited by: Ian Parkinson

  • Difference between genKeyPair() and buildKey()

    I am developing a java card applet which requires key generation. I have to know the exact difference between KeyBuilder and KeyPair. I also want to know the difference between buildKey and KeyPair.
    If buildKey() can be used to generate RSA Public Key and Private Key, How the relationship between the public key and private key is maintained.?
    What type of memory is used by the genKeyPair() method. Transient or Persistent ?.
    For Key Generation what method is recommended?

    Hi,
    Rajesh_Ramachandran wrote:
    I am developing a java card applet which requires key generation. I have to know the exact difference between KeyBuilder and KeyPair. I also want to know the difference between buildKey and KeyPair.
    If buildKey() can be used to generate RSA Public Key and Private Key, How the relationship between the public key and private key is maintained.?buildKey is not used to generate a key. From the javadoc +"Creates uninitialized cryptographic keys for signature and cipher algorithms. Only instances created by this method may be the key objects used to initialize instances of Signature, Cipher and KeyPair. Note that the object returned must be cast to their appropriate key type interface."+.
    What this means is that you still need to set the key material before the key becomes initialised. These objects have no cryptographic value (or usage) until the key material has been set. KeyPair on the other hand will generate a key pair for the given algorithm that you can then get the public and private key from to use in your cryptographic operations.
    What type of memory is used by the genKeyPair() method. Transient or Persistent ?.This would be implementation specific. From my understanding, it is common for a smart cards to have RAM dedicated to cryptographic operations to help improve performance. In these cases, as much of the work as possible is done in transient RAM. For key objects, it is possible to specify where the key material is stored. This is specified when you create the key object (e.g. KeyBuilder.TYPE_DES_TRANSIENT_RESET).
    For Key Generation what method is recommended?The only way to generate a key pair in JC 2.2.1 on card is with the KeyPair class.
    Cheers,
    Shane

  • The Difference Between?

    Ok so I believe I know the answer here but asking anyway.
    What is the difference between the adobe creative cloud team license vs the adobe creative cloud enterprise license?
    is the team licence basically individually licences products per account users?
    and is the enterprise one license that covers multiple users at once?
    Thanks and sorry for the question but had to verify.

    Hi tbirdbrent ,
    Thank you for posting on the forums, the answer to your question is as follows.
    1) Creative Cloud for teams brings together the very latest Creative Cloud desktop apps, updates and upgrades the moment they’re released, and all of the services and business features your team needs to create their best work and collaborate with their peers. Adobe offers two Creative Cloud for teams plans — you can opt for a complete plan (all apps and services) or a single-app plan such as Photoshop CC (access to one app and select services). With each option, you’ll receive access to the same easy-to-use web-based admin console that allows the administrator to centrally purchase, deploy, and manage all seats across your organization — whether single app or complete — under one membership agreement.
    2) Creative Cloud for enterprise is for organizations with large deployments that require centralized provisioning and customized deployment of apps and services. Enterprises also receive enterprise customer support and expert services. Creative Cloud for enterprise also works with Digital Publishing Suite; Adobe Anywhere for video; and Adobe Marketing Cloud, which includes Adobe Experience Manager — all sold separately.
    Also, the team licences is not individually licences products per account users and the same goes with the enterprise license.
    Thanks,
    Vikrantt Singh

  • What is difference between sy-tabix and sy-index.

    SAP Seniors,
    Can you please let me know what is difference between sy-index and sy-tabix.
    I read the SAP help, it is confusing for me. it looks like both are same from help. please help me.
    Thank you
    Anitha.

    HI,
        Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
    SY-TABIX
    Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY-INDEX
    In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
    Hope this helps.
    Thank you,
    Pavan.

  • Difference between sy-tabix and sy-index?

    tell me about sy-tabix and sy-index?what is the difference between sy-tabix and sy-index?
    Moderator Message: Please search before posting. Read the [Forum Rules Of Engagement |https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for further details.
    Edited by: Suhas Saha on Jun 18, 2011 5:33 PM

    HI,
        Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
    SY-TABIX
    Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY-INDEX
    In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
    Hope this helps.
    Thank you,
    Pavan.

  • What is difference between sy-index and sy-tabix and where both are using ?

    what is difference between sy-index and sy-tabix and where both are using ?

    hi nagaraju
    sy-tabix is in Internal table, current line index. So it can only be used while looping at the internal table.
    sy-index is in Loops, number of current pass. This you can use in other loop statements also (like do-enddo loop, while-endwhile)
    SY-INDEX is a counter for following loops: do...enddo, while..endwhile
    SY-TABIX is a counter for LOOP...ENDLOOP, READ TABLE...
    Here is an example from which you can understand the difference between sy-tabix and sy-index.
    Itab is an internal table with the following data in it.
    id Name
    198 XYZ
    475 ABC
    545 PQR.
    loop at itab where id > 300.
    write :/ itab-id, itab-name , sy-tabix, sy-index.
    endloop.
    My output will be :
    475 ABC 2 1
    545 PQR 3 2
    Sy-tabix is the index of the record in internal table.
    sy-index gives the no of times of loop passes.
    So, for the first record in the output (475 ABC), 2 is the index of the record in internal table and as it is first time loop pass occured, sy-index value is 1.
    Regards,
    navjot
    award points

  • Difference between sy-index & sy-tabix

    Dear friends,
    Please tell me the difference between sy-index & sy-tabix
    Actually my problem is i don't know how to compare for example between first record'field n and second record'field n when u r in loop so i can take particular action based on result
    on current recor
    if possible send me sample code.
    Regards;
    Parag Gavkar.

    SY-TABIX:
    Current line in an internal table. With the following statements SY-TABIX is set for index tables. With hashed tables, SY-TABIX is not filled or it is set to 0.
    - APPEND sets SY-TABIX to the index of the last table row, that is the total number of entries in the target table.
    - COLLECT sets SY-TABIX to the index of the existing or appended table row. With hashed tables, SY-TABIX is set to 0.
    - LOOP AT sets SY-TABIX to the index of the current table row at the beginning of every loop pass. After leaving a loop, SY-TABIX is set to the value it had before entering the loop. With hashed tables, SY-TABIX is set to 0.
    - READ TABLE sets SY-TABIX to the index of the table row read. If no row is found with binary search while reading, SY-TABIX contains the index of the next-highest row or the total number of rows +1. If no row is found with linear search while reading, SY-TABIX is undefined.
    - SEARCH itab FOR sets SY-TABIX to the index of the table row, in which the search string was found.
    SY-INDEX:
    SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.
    Regards,
    Santosh

  • Difference between Null and null?

    What is the difference between null and NULL?
    When is each used?
    Thanks,

    veryConfused wrote:
    There is a null in java, but no NULL. null means no value. However, when assigning value, the following is different:Although the empty String has no special role. Null means, the referential type is not assigned (doesn't refer) to a specific object. The empty String is just another object though, so seeing it or pointing it out as something special when it actually isn't at all (no more special than new Integer(0) or new Object[0]) just adds to the confusion.

  • Blends: Difference between open and closed paths modifying spine

    Okay, just had a discovery today about the blend tool.
    The difference between closed paths and open paths is critical when you want to modify a blend spine, such as make it curve. Between open paths, there is no spine shown when a blend is created. Ever notice this? Between closed paths, there is a spine, which can be modified, such as making it curved. Now, the trick is how to modify a spine with open paths when there is no spine shown. Found out today that starting with a closed path, segments can be deleted to make the path open, then the spine can be modified and the open path state maintained!
    This is a huge bug in Illustrator and makes no sense to me. Wanting Adobe to fix this in the next major release. Hope this helps anyone struggling with this issue.

    One thing you should be aware of concerning open ended splines:
    It makes an enormous difference as to how the blend behaves whether the endpoints have handles or not.
    Give them handles and you will find that you can alter the distribution of the blend objects just by adjusting the handles or by dragging on the spline itself.
    Give it a try.

  • Difference between cleared items,open items and all postings (FI).

    Hi experts,
    Can anybody tell me the difference between cleared items,open items and all postings for an account.
    While running corresponding bapis and transaction FAGLL03 (for GL) or FBL1N (for accounts payable) i found that in some cases all postings is less than cleared items or open items for a time period. How could it happen.According to my knowledge all postings should contain cleared items and open items.
    Please correct me..
    Thanks and Regards
    Arjun

    Hi Arjun,
    For every Billing Documnet created(VBRK/VBRP-VBELN) there will be an accounting document created in BSID/BSAD tables.
    OPEN ITEMS means the Billed/Invoice Amounts that are pending from Customers, i.e which we have to receive from Customers.
    CLOSED ITEMS means the AMOUNTS received from that customer.
    OPEN ITEMS : fetch data from BSID table Only
    CLOSED ITEMS : fetch data from BSAD only.
    ALL POSTINGS : fetch data from both BSID and BSAD.
    Hope this will help.
    Regards,
    Nitin.

  • Disk Utility: Differences between "Zero Out Data" and "7-Pass Erase"?

    I'm wondering if anyone knows if there's a significant difference between the "Zero Out Data" erase option in Disk Utility (specifically Disk Utility 10.5.5), and the "7-Pass Erase" and "35-Pass Erase" options in same software.
    Here's why I'm asking: I have a co-worker with an iMac G5 20" 1.8GHz with 160GB internal hard drive. As a result of the power supply overheating a week ago due to dust, some hard drive problems resulted. I'm trying to assess whether these are 'soft' formatting problems that can be recovered from, or 'hard' problems requiring replacement of the hard drive and/or power supply.
    Following the failure, I removed the dust and restored the iMac to servicable form. The power supply seems to be OK now. The next thing was to attempt to recover as much data as possible from the 160GB, as the last full backup was a week old. Carbon Copy Cloner, shell copy via 'sudo cp -p -R -v', Finder copy, and DiskWarrior recovery all met with problems. TechTool Pro identified a huge swatch of unreadable sectors during repeated surface scans. Unfortunately, these unreadable sectors were located midway in the OSX boot partition (an 80GB partition), and not in the other 80GB partition devoted to lower priority video data.
    When I was satisfied I had backed up the data to the best of my abilities, I next set out to reformat the drive and see if the bad sectors could be eliminated or remapped out of existence. I did a "Zero Out Data" erasure in Disk Utility (with no errors during the erase), but TechTool Pro showed the bad sectors persisted in equal strength at the same location. I next executed a sixteen hour "7-Pass Erase" (again no errors, and confirming that it takes about an hour per 10GB). The next day when I ran TechTool pro, all of the sector errors had disappeared. I'm a bit perplexed as to why the "7-Pass Erase" seems to have recovered the use of the drive. Is it possible that there are simply thousands of bad sectors now remapped that I'm not seeing? [If so, how do I check for this?] TechTool Pro has not reported any S.M.A.R.T. issues to date on the drive. What am I to make of that?
    There are some related threads I've checked into, but I'm not sure how to properly assess my situation based on this information:
    <http://discussions.apple.com/thread.jspa?threadID=232007>
    <http://discussions.apple.com/thread.jspa?threadID=138559>
    <http://discussions.apple.com/thread.jspa?threadID=118455>
    Since the iMac has three weeks left on it's one year warranty, and I've already moved the user to another machine temporarily, I'm thinking that the smart thing to so is to send it in to Apple to have them look at the power supply and hard drive. That way, when it returns, even if there is still a lingering hardware problem, at least it will be covered under warranty for another 90 days.
    Any thoughts?
    iMac G5 20" 1.8GHz   Mac OS X (10.4.6)   1.25GB RAM, 160GB hard disk, SuperDrive

    HI, Bret.
    The only differences between "Zero Out Data", "7-Pass Erase", and "35-Pass Erase" are the number of times a binary zero is written to every bit on the disk. "Zero Out Data" writes a binary zero once, whereas the 7- and 35-Pass options write a zero seven and 35 times, respectively.
    Technically, one pass with Zero Out Data should be sufficient to map bad sectors out of service, a process also known as sparing. If a bad sector is encountered, it is both marked as "in use" in the directory's allocation table and added to the directory's "bad blocks file."
    My understanding is that the Surface Scan of Tech Tool Pro should identify bad sectors every time it is run unless the bad sectors have been locked out by the drive controller of the ATA drive itself. This is because Surface Scan checks the entire surface of the disk.
    What may have happened is that running "Zero Out Data" spared the bad blocks from a directory standpoint, but did not result in the drive's controller locking out those sectors for reasons detailed in the "Surface Scan" section of the Tech Tool Pro manual. However, the 7-Pass Erase may have resulted in the drive's controller locking out the bad sectors and why Surface Scan did not pick them up after such.
    Given the problems you described, I concur with your plan to have Apple check the affected computer. You might also want to consider purchasing an AppleCare Protection Plan for that Mac: I recommend and buy these for all my Macs.
    For some additional information on bad sectors, see the "Bad Sectors" section of my "Resolving Disk, Permission, and Cache Corruption" FAQ.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

Maybe you are looking for

  • IPod Touch 3rd Generation 32 GB will not charge, sync, nor turn on

    I've had this iPod since about January/February 2010. I've had this issue ever since May 20th, 2012 .When I plug it into an adapter, it shows the very low battery red sign, and when it is plugged in, it shows that it is charging. However, when it rea

  • Issue in MaxL

    Hi all, Iam using MaxL statements for validating and backup of the databases. The statements are as follows: MAXL> alter database app1.db1 validate using error_file "E:\hyperion\samp.txt"; MAXL> export database app1.db1 data to data_file "d:exp.txt";

  • Java running old class file

    When I make a change to a Swing program and compile, it runs the old version, as if the changes were never made. Any ideas? I make a new directory and copy the java file, re-compile and it works...but I don't want to have to do that every time. Dan

  • One or more hierachies in one report which differs for each user

    Hi BI Gurus, Can we have more than one hierarchy in one report which enables different hierarchy for diff user. The requirement is like this. We have almost 10 hierarchies.. Each user is restricted to view a particular hierarchy only. Is this possibl

  • SET/GET Parmaeter

    Hi All, I have one Z include ,now i want to execute it on SET/GET Parameter how can i do this. include will execute when ZTest_param = 'X'. Thanks, Mahipal.