String assignment ?

Hi,
in the following code:
public class Test {
public static void main(String[] args) {
String s = new String("Welcome to Java");
Object o = s;
String d = (String)o;
System.out.println(o + s + d);
Both strings and the object are referring to the same string object., and the println shows 3 "Welcome to Java" 's. I don't understand exactly why this is so? I was hoping someone might be able to explain it to me.
Thanks!
Jimbo
think

First of all, I was under the impression that when
you declare a string variable and use the new keyword
that what you were doing was constructing a String
object (to which you can apply the functions of the
String class). Yes. But you don't NEED to do new String(...) to get a String object. Usually you just assign it to a String literal (s = "abc";) or get it from a config file or user input, or call some object's toString() method.
I am unclear what is actually happening when the code
"Object o = " was used. Is the Object class the
super (or parent) class, so that a String is
automatically in the Object class because it is its
parent? Correct.
I take it that after that line of code, we
have two reference variables pointing at the
String......and then the second "String = " statement
is just making another reference to the same String.Correct.
With the family example you gave me.....applying it
this string.....the three variables are just three
different points of reference to the same string. Correct.
As far as why I thought it might be any
different....earlier on in the class
we had code that went kinda like this:
String s = "me";
String t = "you";
s = t;
I guess in this case we lost our reference to the
String "me", so if we println s and t we get two
"you" 's.Correct. So, why would printing a + b + c (or whatever your variables were in the initial post) produce anything but three of the same thing? I still don't know what you expected or why.
I guess I was getting this all
confused....probably making it more difficult than it
actually is...but I have a lot coming at me at
once.....Actually, it sounds like you have a better handle on how Java's reference variables work than most beginners. The idea that the variable holds a reference, not an object, and that assignment doesn't copy an object, comes hard to some people. You sound like you understand that part of it.

Similar Messages

  • Accessing String assigned in a JSP from a Servlet?

    Hello all, I was wondering if there is a way to access a String object that was assigned by an HttpSession object in a JSP from a Servlet. What happens is, in my application a user logs in, an HttpSession object is instantiated and all of the user credentials are assigned within a JSP like:
    HttpSession httpSession = request.getSession( false );
    String userName = httpSession.getAttribute("userName);
    ...{code}
    Next, I have a Servlet (which is really just a Proxy to a different server), that I need to log some information with, namely the userName String. Is there a way I can access that String without instantiating another HttpSession object? Because when the timeout occurs (or when the user clears his cache I have found), the HttpSession becomes invalidated (even if I use  +HttpSession#getSession( true )+) and the +HttpSession#getAttribute+ call fails (userName is just null). So is this possible to do?
    Thanks in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    dnbphysicist wrote:
    I understand you cannot recover attributes from a dead session, this is why I wanted to be able to access a variable that is pulled from the Session immediately after login so I can still get to it even once the session is dead.
    Normally a session doesn't go dead after login.
    I imagine that by using application scope the app would confuse the userName with other users that are logged in?Certainly. It was just an example. But your data clearly belongs in the session, so just keep it in the session. If the session get invalidated while it should not get invalidated, then your problem truly lies somewhere else.
    I am definitely not arguing you latter point either :) A lot of this code I inherited unfortunately from previous developers and we are in desperate need of a redesign.I wish you much luck with that.

  • How to get String assigned value

    Hi,
    As String is immutable and we know that the value of string is not changable.
    eg: String abc= new String();
    abc = "INDIA";
    system.out.println("1st abc : "+abc);
    abc=abc.toLowerCase();
    system.out.println("2nd abc : "+abc);
    As we know as string is immutable the value for the 2nd abc gives us india.As 2nd abc creates a new instance object stores in new memory location.
    Then y string is called immutable.It means the value is getting changed.
    Is their a way to retrive my original value or first assigned value for abc i.e INDIA.
    Thanks
    LeoSun.

    LeoSun wrote:
    Then y string is called immutable.It means the value is getting changed.No, it is not changed, you just assign a new value to your variable 'abc'.
    String abc = "INDIA";
             +-----------+
    abc -----+-> "INDIA" |
             +-----------+
    abc = abc.toLowerCase();
             +-----------+
    abc ---+ |   "INDIA" |
           | |           |
           +-+-> "india" |    
             +-----------+As you see, "INDIA" is not changed, a new String, "india" is created where your variable 'abc' points to.
    Is their a way to retrive my original value or first assigned value for abc i.e INDIA.
    ...Once you change the value of 'abc' (and there exists no reference to it's old value), then no, it's not possible.
    Why would you want that?

  • Simple String assignment

    I'm using netBeans...if that matters. I've never seen this error before while assigning content to a string. Can anyone tell me why this is happening?
    textForArtist is a JLabel.
    found : java.lang.String
    required: com.sun.org.apache.xpath.internal.operations.String
    this.artist = textForArtist.getText();
    Thanks in advance.

    textForArtist.getText() returns a java.lang.String object.
    What type is this.artist? Looks like it's a com.sun.org.apache.xpath.internal.operations.String type, according to the error message. That isn't compatible with a java.lang.String expected type, hence the error. Did you really expect that since both class names happen to end in "String" that it would just work as if by magic?

  • Plsql string assignment

    Hello,
    after creating a report with a type of "sql query(PL/SQL function Body returning sql query)" I will always have an error message as follows:
    At first here is my pl/sql code:
    declare
    q varchar2(3000);
    begin
    q:='select empno,';
    q:=q||'ename,';
    q:=q||'hiredate,';
    q:=q||'job from emp';
    q:=q||'where ';
    q:=q||'job='SALESMAN' ';
    return q;
    end;
    The error message:
    1 error has occurred
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing
    (ORA-06550: line 9, column 13:
    PLS-00103: Encountered the symbol "SALESMAN" when expecting one of the following:
    . ( * @ % & = - + ; < / > at in is mod not rem
    <> or != or ~= >= <= <> and or like
    between ||
    The symbol ". was inserted before "SALESMAN" to continue.)
    Thanks for helping and solving the problem.
    My

    Ensure that hard-coded constants are enclosed within a set of double single-quotes (or like you said, the apostrophe) - double quotes won't work and neither will a set of single quotes. Here is the example that I keep for reference:
    <pre>
    SQL_STATEMENT := 'SELECT A.CORONER_CASE_ID CASE'
    || ' , TO_CHAR(A.PRONOUNCED_DATE,''YYYY-MM-DD'') PRONOUNCED'
    || ' , B.E_DEATH_MANNER_DESC DEATH_MANNER'
    || ' , C.FIRST_NAME_TX || '' '' || C.LAST_NAME_TX NAME'
    || ' , A.EMPLOYEE_ID EMPLOYEE_ID'
    || ' , HTMLDB_ITEM.CHECKBOX(1,A.PRELIM_COMP_IND,NULL,''Y'') PRELIM_COMP_IND'
    || ' , HTMLDB_ITEM.CHECKBOX(2,A.REVIEWED_HO_IND,NULL,''Y'') REVIEWED_HO_IND'
    || ' FROM CORONER_CASE A'
    || ' , MANNER_OF_DEATH B'
    || ' , EMPLOYEE C'
    || ' WHERE A.DEATH_MANNER_CD = B.DEATH_MANNER_CD (+)'
    || ' AND A.EMPLOYEE_ID = C.EMPLOYEE_ID' ;
    </pre>

  • How to assign the dynamic value of PV to Sip Header in ICM?

    Hi everybody,
    I would like to ask your help, please. We are working on Temporary IVR Handoff (ICM+CVP). I need to add/modify a customer Sip header in ICM transfer script. The value for that header is dynamic and stored in the one of ICM Call Peripherial Variables (PV9, for examle).
    Is it possible somehow to assign the value of that PV9 to Sip header (Set Variable Call.SipHeader)? I tried to do it but unfortunally without any success. I can assign any static string, but how to assign the value of the PV??? That's the question...
    For static string assignment the syntax of the Set Variable Node (Call.SipHeader) looks like that:
    "IVR-Handoff~add~It's Cisco"
    and it works fine.
    For dynamic value (PV9) I tried:
    "IVR-Handoff~add~Call.PeripherialVariable9" - it add Call.PeripherialVariable9 as a string, but not it's value;
    "IVR-Handoff"~add~Call.PeripherialVariable9 - returns a syntax error;
    Call.PeripherialVariable9 - no Sip header is added.
    What do you think? Is it doable at all?
    Any ideas, answers or examples how to do it would be much appreciated.
    Thank you in advance.
    Dmitriy.

    Hi Senthil,
    Yes! It works, but with the little difference. The right answer is:
    "IVR-Handoff~add~"&Call.PeripherialVariable9
    (Call.PeripherialVariable9 is without quotes, otherwise it insert the name of the variable, but not it's value)
    The other solution is shown here (thanks to Paul Tindall):
    http://developer.cisco.com/web/cvp/forums/-/message_boards/message/15627744?p_p_auth=6psgR8ML
    concatenate("IVR-Handoff~add~",Call.PeripherialVariable9)
    Thank you so much for the idea! I very appreciate your help and vote you.

  • When same search strings are given, during EBS upload system not picking up

    Hi,
    We have a total of 7 company codes and have different -different seach strings assigned to each of them in EBS config. But now my client want to have a same seach string for two company codes, when configured in ECC 6.0 , and tried to upload the statement neither of the company codes are getting the bank statement uplaoded. Is there a way where we can assign company code wise so that the bank statement gets uploaded.
    Thanks and Regards
    Sri

    Hi,
    I think this should be possible. Different company codes will have different House banks and Accounts ID.
    The same search string can be used for each of the company code and house banks. This happend when after defining the search string, you assign these strings as above.
    Tip : Please also check in the "TEST", by copying the search string from the bank file and see if the mapping is being hit.
    Rgds,
    Suresh

  • Assign color to findTextPreference as object

    I have a script that creates a color, applies it to a particular property of a number of styles (one after the other) and then searches for that property. This works just fine the first time I run it in an InDesign session, and usually the second and third times as well. However, at some point I find that it stops working, because when the color is assigned to the findTextPreference property it is assigned as a string that gets some numbers after it. So, I do something like this:
    var myColor = myDoc.colors.itemByName("testCol");
    myCSty.underlineGapColor = myColor;
    app.findTextPreferences.underlineGapColor = myColor;
    However, if I then query app.findTextPreferences.underlineGapColor, it is a string, and that string will be something like "testCol 3" (it iterates upwards depending on how many times I've run it during a session). I can't change the string; assigning NothingEnum.NOTHING to the property and then reassigning the color just iterates the number again. In fact, even if I try to assign that color to a different color property, or to a findGrepPreferences color property, it continues to iterate the number. I so far have not been able to recreate this problem in a less complex script (I'm still trying), but I was hoping someone might have encountered this and might have some guidance.
    I thought that the problem might be related to the bug discussed here: fillColor in find/change Preferences in indesign cs3 so I started adding my colors at the app level as well. This doesn't seem to hurt anything, but it doesn't help either. And trying to assign the color whose parent is app to my findTextPreferences property just gives me the error seen there (I guess that means the bug was fixed? I'm not sure.)
    Is there any way to force the findTextPreferences properties to accept an object rather than converting that object into a string? Or is my problem too vague and unrepeatable to help at this point?
    Thank you!

    Upon further testing of this, it seems like the issue is rooted in one particular document which, if open, can experience this problem or cause it to occur in other documents (like it's polluting the session). I have no idea why, but since I can't provide the file it's not something anyone is likely to be able to recreate or help me with. Not sure if I should delete my question or close it, or what.

  • Variable created as String in HP Calc Manager

    Hi,
    I have created a variable which is type 'String' associate to a member which has datatype text. I expect the users when they run the rule to populate that with free text which is for information. However the rule doesnot validate.
    Any tips on how do I get the same working.
    Thanks,
    XXX

    What he said was take that as a reference, and that is a script in Capex where a string assignment through rule was working.
    Tell us what is not working, if you can post your script and then someone can look at it and see what the problem is.
    Can you enter text from Webform (not using rule)
    Regards
    Celvin

  • Where we can find the detail infomation about the Value String of automatic

    Where we can find the detail infomation about the Value String of automatic?
    such as WE06,WE01 and so on.

    Hai,
               Value string keys are for SAP internal usage. It is just a pointer to the transaction event key which is necessary for automatic account determination.
               Movement types are linked to transaction keys via valuation string in OMWN T-code.
               The R/3 System automatically determines the value string assigned to a specific transaction. It depends partly on entered parameters manually and partly on parameters derived internally by the system. The value string contains all posting transactions that are possible for a certain transaction. The program decides which of these posting transactions lead to G/L account postings in individual cases. You cannot define this in Customizing.
    Value string WE01, for the goods receipt for a purchase order into stock, contains transactions BSX and WRX.
    WE01: BSX, WRX, PRD, KDM, EIN, EKG, BSV, FRL, FRN, BSX, UMB.
    WA14: BSX ,PRD, BSX, UMB
    WA01: BSX, GBB, PRD, BSX, UMB
    Value string RE05 contains transactions BSX and UMB.
    In the standard system, value string WE01 is assigned to goods receipts (and also cancellations and return deliveries) for Standard and Subcontracting purchase order items without account assignment concerning valuated material into stock. In the case of (valuated) goods receipts for purchase order items not subject to account assignment,
    post the items to a stock account using the transaction key BSX and make an offsetting entry to a GR/IR clearing account. A price difference posting (transaction key PRD) is only used if the valuated material is subject to standard price control and if the order price (or invoice price) is different from the standard price. Transaction key KDM is required in Inventory Management for purchase orders in foreign currencies because of differences in exchange rates between goods receipts and invoice receipts, unless the material can not be debited or credited because it is subject to standard price control.
    The transaction keys EIN and EKG (and possibly FRE – see account determination for delivery costs) are only used in company codes where purchase account management is active (as required in France and Belgium for example).
    The transaction keys BSV, FRL, and FRN are only used for the Subcontracting item category.
    Value string WA14 is defined for deliveries without charge (movement type 511).
    The following scenarios are possible:
    Delivery without charge for material subject to moving average price control &#8594; No accounting document
    Delivery without charge for material subject to standard price control (and if the posting date is in the previous period – standard price in the posting period = standard price in the current period) &#8594; Inventory posting (receipt at standard price) and offsetting entry to price differences account
    Delivery without charge for material subject to standard price control, with posting date in the previous period and the standard price in the posting period is different to the standard price in the current period &#8594; Inventory posting (receipt at standard price) and offsetting entry to price differences account (posting in the previous period) &#8594; Stock correction posting and Revenue/expense from revaluation (posting in the current period)
    In the standard system, value string WA01 is assigned to goods issues and other goods receipts. The R/3 System uses an additional influencing factor, account grouping, to differentiate further between the various movements during account determination.
    Hope it will be Helpful 4 u.
    Reward Point if Useful.

  • Beginner : Array , String Problems continue.

    Hi everybody I am so New in Java or rather not really able to understand Java yet.
    I have assignment where I do not know how to think anymore..is probably very easy to those who understand programming but sadly I do not.
    Program should do:
    1. assign any amount of different strings.
    2. user is giving any letter he/she wants and program to find it among given strings.
    If searched letter is in any string/ strings , only these strings or string are printed.
    3. If in given strings is not searched letter, program has to say it, for ex: there is not letter you search for.
    As long as now I have only, strings assigning to array. So there are strings in array but I do not know how to write code where I can find given letter by user.
    I just do not know how I should think(anymore at all ;)) here. I am really frustrated and desperate, how to understand this?? Once and for all!!!
    I was thinking maybe I should use ArrayList? but how...or Can it be done both ways with Array or with ArrayList?
         public static void main(String[] args) {
              Scanner scan = new Scanner(System.in);
              System.out.print("How many strings ?");
              int antal= scan.nextInt();
              String [] str = new String[antal];
               String string = null;     
              int x;
               scan.nextLine();
                 for( x=0;x<str.length;x++){
                      System.out.print("String "+(x+1)+": ");                       
                 string= scan.nextLine();
                 str[x]= string;
                System.out.print("Write a letter you wish to find :");
                String letter = scan.nextLine();
                char check = letter.charAt(0);
      //somthing in here ....

    Thank you very, very much for helping me, this is the first forum where I am getting any answers at all. Thanks guys!
    Yes, that is true I have a problem to "see" things in code..I feel " lost in translation " :)...Sometimes I think I understand code and than suddenly code does total different thing than I thought. I have to pass 2 exams of Java basic and bit advance level of Java , all seems very dark now..but I have a hope that I at least pass those exams. Of course it could be fantastic to start understand Java (or any other computer language) and be able to code one day for real. To be honest, I envy you that you can understand Java. When, all code works is so cool and fun! ok, Back to code...
    So I read your tips and advices , thanks.
    Here is another problem, with help of indexOf(char) I got index for character I searched, fine.
    The way i wrote the code I got separate answer for each string(check in code). What I need to have is, separate printed strings where given character is found and nothing else should be printed. Later, I need just one general comment ,only in case if character is NOT found in given strings.
    import java.util.*;
    public class upp9 {
         public static void main(String[] args) {
              Scanner scan = new Scanner(System.in);
              System.out.print("How many strings ?");
              int antal= scan.nextInt();
              String [] str = new String[antal];
              int x;
               scan.nextLine();
                 for( x=0;x<str.length;x++){
                      System.out.print("String "+(x+1)+": ");                       
                 str[x]= scan.nextLine();
                System.out.print("Write a letter you wish to find :");
                String letter = scan.nextLine();
                char check = letter.charAt(0);
                   for( x=0;x<str.length;x++){
                       str[x].indexOf(check);
                     //     System.out.println("String "+(x+1)+" "+str[x].indexOf(check));
                if((str[x].indexOf(check))>=0)
                     System.out.println("String "+(x+1)+" "+str[x]);
                else
                     System.out.println("Nothing in this string");
      System.out.println();
    }is printed.
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find :a
    Nothing in this string
    Nothing in this string
    String 3 alex
    String 4 batmanI should get printed (with other code)...where I don't know how to think here? what code I should use?, what I can what I can not do here...hmmm
    //in case found
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find :a
    String 3 alex
    String 4 batmanor....
    //in case NOT found
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find : j
    Not found

  • Valuation String in MM

    Dear All
    I would like to understand the significance of Valuation String in account determination.
    It is attached to the movement type but what is the exact utility.I mean we could have attached directly movement type to the transaction event key but why do we need valuation string?
    Regards

    Hai,
    Value string keys are for SAP internal usage. It is just a pointer to the transaction event key which is necessary for automatic account determination.
    Movement types are linked to transaction keys via valuation string in OMWN T-code. The R/3 System automatically determines the value string assigned to a specific transaction.
    It depends partly on entered parameters manually and partly on parameters derived internally by the system.
    The value string contains all posting transactions that are possible for a certain transaction.
    The program decides which of these posting transactions lead to G/L account postings in individual cases.
    You cannot define this in Customizing.
    Value string WE01, for the goods receipt for a purchase order into stock, contains transactions BSX and WRX.
    WE01: BSX, WRX, PRD, KDM, EIN, EKG, BSV, FRL, FRN, BSX, UMB.
    WA14: BSX, PRD, BSX, UMB WA01: BSX, GBB, PRD, BSX, And UMB
    Value string RE05 contains transactions BSX and UMB.
    In the standard system, value string WE01 is assigned to goods receipts (and also cancellations and return deliveries) for Standard and Subcontracting purchase order items without account assignment concerning valuated material into stock.
    In the case of (valuated) goods receipts for purchase order items not subject to account assignment, post the items to a stock account using the transaction key BSX and make an offsetting entry to a GR/IR clearing account.
    A price difference posting (transaction key PRD) is only used if the valuated material is subject to standard price control and if the order price (or invoice price) is different from the standard price. Transaction key KDM is required in Inventory Management for purchase orders in foreign currencies because of differences in exchange rates between goods receipts and invoice receipts, unless the material can not be debited or credited because it is subject to standard price control.
    The transaction keys EIN and EKG (and possibly FRE – see account determination for delivery costs) are only used in company codes where purchase account management is active (as required in France and Belgium for example).
    The transaction keys BSV, FRL, and FRN are only used for the Subcontracting item category. Value string WA14 is defined for deliveries without charge (movement type 511).
    In the standard system, value string WA01 is assigned to goods issues and other goods receipts. The R/3 System uses an additional influencing factor, account grouping, to differentiate further between the various movements during account determination.
    at company code level chart off accounts will be assigned, at valuation area level valuation grouping code has to assign
    For the material if Qty and value updation is activated  at the time only system goto find the value string,
    when you do the goods receipt or invoices at the time system find the value string based on the value string system will post to the GL accounts
    Regards
    Pramod

  • Value strings

    HI frndz...
    when we goto Account grouping of the mvt. types we find various Value strings.
    For eg: WE01, WA01,WF01, WF03, WE06, WE04, WA03 AND SO ON..
    I just want to knw vat are these Value string / thier significance.
    I knw  WE - is for receipt,
               WA - is for issue.
    vat is the significance of the 01,03,04,06,11 ... (in we01, we06 etc...).
    also vats the use of counter (Cn) ???
    Thanks in advance..
    Amit P Hiran
    njoy SAP..
    njoy Lyf.....

    Hi,
    Value string keys are for SAP internal usage. It is just a pointer to the transaction event key which is necessary for automatic account determination.
    Movement types are linked to transaction keys via valuation string in OMWN T-code. The R/3 System automatically determines the value string assigned to a specific transaction.
    It depends partly on entered parameters manually and partly on parameters derived internally by the system.
    The value string contains all posting transactions that are possible for a certain transaction.
    The program decides which of these posting transactions lead to G/L account postings in individual cases.
    You cannot define this in Customizing.
    Value string WE01, for the goods receipt for a purchase order into stock, contains transactions BSX and WRX.
    WE01: BSX, WRX, PRD, KDM, EIN, EKG, BSV, FRL, FRN, BSX, UMB.
    WA14: BSX ,PRD, BSX, UMB WA01: BSX, GBB, PRD, BSX, UMB
    Value string RE05 contains transactions BSX and UMB. In the standard system,
    value string WE01 is assigned to goods receipts (and also cancellations and return deliveries) for Standard and Subcontracting purchase order items without account assignment concerning valuated material into stock.
    In the case of (valuated) goods receipts for purchase order items not subject to account assignment, post the items to a stock account using the transaction key BSX and make an offsetting entry to a GR/IR clearing account. A price difference posting (transaction key PRD) is only used if the valuated material is subject to standard price control and if the order price (or invoice price) is different from the standard price.
    Transaction key KDM is required in Inventory Management for purchase orders in foreign currencies because of differences in exchange rates between goods receipts and invoice receipts, unless the material can not be debited or credited because it is subject to standard price control.
    The transaction keys EIN and EKG (and possibly FRE  see account determination for delivery costs) are only used in company codes where purchase account management is active (as required in France and Belgium for example).
    The transaction keys BSV, FRL, and FRN are only used for the Subcontracting item category.
    Value string WA14 is defined for deliveries without charge (movement type 511).
    The following scenarios are possible:
    Delivery without charge for material subject to moving average price control u2192 No accounting document Delivery without charge for material subject to standard price control (and if the posting date is in the previous period
    standard price in the posting period = standard price in the current period) u2192 Inventory posting (receipt at standard price) and offsetting entry to price differences account
    Delivery without charge for material subject to standard price control, with posting date in the previous period and the standard price in the posting period is different to the standard price in the current period u2192 Inventory posting (receipt at standard price) and offsetting entry to price differences account (posting in the previous period) u2192 Stock correction posting and Revenue/expense from revaluation (posting in the current period) In the standard system, value string WA01 is assigned to goods issues and other goods receipts. The R/3 System uses an additional influencing factor, account grouping, to differentiate further between the various movements during account determination.

  • Valuation string in movement types - Inventory Management

    Hi,
    what is meant by Valuation String. and i've seen the valuation string assigned to movement types.
    for ex: WE01 and WE06 is assigned to Mvt Type 101 in account grouping.
    pls list all the valuation string and explain the purpose of valuation string.
    Regards,
    Bala

    Hi
    Posting string for values
    Indicates the posting rule that always contains the same account assignment characteristics for a certain transaction or event (for example a goods movement or an invoice receipt).
    The posting string is needed for the purposes of automatic account determination.
    Use
    Through the allocation of a posting string to a movement type, the system automatically determines the G/L accounts to be updated in the event of a goods movement.
    Definition: posting string
    The definition of a posting rule that always has the same account assignment characteristics for a certain business transaction.
    The posting string is required for automatic account determination.
    These value string WE01,WE06 plays an important role in
    Automatic Accoutn determnination. You have maintain in
    SM30.
    you have maintain in SM 30
    Table T156W -Value string
    T156M for Quantity string.
    Whenever Goods movement (or) invenotry posting takes places we are not giving the G/L account ,The G/L accounts are taken automatically.
    In real time we are not modfiying anything. it is Std SAP
    If you are copying a New Movement type then you have to define the WE01 & WE06 Value String & Qty string.
    you choose a value string and qty string.
    The value strings controls the G/L account determination for transactions covered by the movement type
    G.Ganesh Kumar

  • Strings are immutable

    I want to know what exactly it means when u say that Strings r immutable.I need to understand with ex.please.There r StringBuffers to handle it we say.
    We can concatenate a string with another too. SO what is immutable means?
    CAn anyone help?Thanks in advance.

    Immutable means that the object can not be modified after it is constructed. For Strings, there are no methods that allow the value of the String to be changed. Thus, for a every new value, a new String object must be created. StringBuffers on the other hand, have methods like append and setCharAt that allows the value stored to be changed. You can create one StringBuffer object and keep altering it.
    Concatenation does not actually modify a String. It creates a new one. Notice how you have to assign the concatenated value to something.
    String str1;
    str1 = "test ";
    str1 + "string";
    System.out.println(str1);  // concatenation didn't modify str1
    str1 = str1 + "string";  // assign a new string which is the concatenation of str1 and "string" to str1
    System.out.println(str1);  // str1 refers to a completely new String, the concatenation
    StringBuffer sb1;
    sb1 = new StringBuffer("test ");
    sb1.append("string");
    System.out.println(sb1);  // sb1 was modified
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for