How to change value of Integer object ?

I wrote a program:
public class Tester{
     public static void changeValue( Integer a, int b ){
          a.valueOf(b);
     public static void main( String[] args ){
          Integer a = new Integer(15);
          Tester.changeValue(a, 20);
          System.out.println(a); // It will print to screen the value 15, but i want it is 20.
}Can you help me?????

Create a Value Object.
public class MyInteger {
    // The encapsulated property (required).
    private Integer value;
    // Always declare a default no-arg constructor if you have declared another constructors (javabean spec).
    public MyInteger() {
        // Default constructor, keep alive.
    // This constructor is here so that you don't need to call setValue() after default construction (optional).
    public MyInteger(Integer value) {
        this.value = value;
    // The getter of the encapsulated property (required).
    public Integer getValue() {
        return value;
    // The setter of the encapsulated property (required).
    public void setValue(Integer value) {
        this.value = value;
    // The string representation of this object which pleases reading in logs (optional).
    public String toString() {
        return "MyInteger[" + String.valueOf(value) + "]";
public class Tester {
    public static void changeValue(MyInteger myInteger, int b) {
        myInteger.setValue(new Integer(b));
    public static void main(String[] args) {
        MyInteger a = new MyInteger(new Integer(15));
        Tester.changeValue(a, 20);
        System.out.println(a);
}

Similar Messages

  • How to change Font Size of Object Explorer in "SQL Server Management Studio"

    Dear Team,
    "SQL Server Management Studio" is a fantastic IDE for the database.
    There are so many customization options available but one thing many users missing is that " How to change Font Size of Object Explorer?"
    Can you please accumulate this feature in IDE ASAP?
    Many Thanks,
    Bhavesh

    Its there
    Go to Tools -> Options
    Then under Environment you've fonts and colors tab where you can specify a higher font size.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to change the Workflow Business Objects

    Hi,
    How to change the Workflow Business Objects. I need to add custom code to the Method. can I create only custom method or I need to copy the existing object to Custom object .
    Thanks
    Niranjan

    Hi,
    Check the following link:
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://www.sapmaterial.com/badi.html
    Regards,
    bhaskar

  • How to change value of ${eol} from \n to \r\n, writing by File Adapter

    Hi All,
    How to change value of ${eol} from \n to \r\n, while writing file through File Adapter.
    As my file is being created in Linux environment, so for new line separater, \n is used. I mounted this file directory to windows System.
    As Windows requires \r\n for new line seperator. So I need to change value of ${eol} in the Schema created for file writing.
    Can any one provide help regarding this.
    Thanks in advance

    Hi,
    When an XML payload is written to a file \n would be used as the default line separator regardless of if its windows or linux, as per the XML specification http://www.w3.org/TR/REC-xml/#sec-line-ends.
    As such, one need not worry about the line separators because, the XML file would eventually be processed by a parser which usually would be able to understand both line endings (as they are whitespace characters as far as the parser is concerned).
    If you want to convert the line terminators (for readability etc), 10.1.3.4 has a new feature - in the XML schema definition for the file adapter payload, add these two top level directives to the schema element:
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    nxsd:normalizeLineTerminators="false"
    Regards,
    Shanmu.

  • How to change value of instance variable and local variable at run time?

    As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
    Suppose I have a class, say employee like -
    class employee {
    public String name;
    employee(String name){
    this.name = name;
    public int showSalary(){
    int salary = 10000;
    return salary;
    public String showName()
    return name;
    i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
    My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
    Can someone tell me how to change these value?
    Please help
    Regards,
    Sujeet Sharma

    This is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.

  • How to change values of a characterstic at runtime?

    Hi,
    How to change the values of characterstic at runtime?
    for example if the characterstic contains values like P and A. i need to change all the P values as PLAN in the query output at runtime.
    Note: I cant use cell editor, because there are no stuctres in the query definition.
    Regards,
    Ravi

    Hi,
    Probably i was not clear in my question.
    for example characterstic ZPL contations Keys P and A with respectve texts PL and AC.
    but in the 10th query they dont want to see the text as PL but as PLAN. in the remaing queries they want to see the text as PL.
    I know we can do it using table interface in WAD-Table web item.
    If there any we can do this requirement in Bex designer?
    Regards,
    Ravi.

  • User Exit: AFAR0002. How to change value in field: ANLC - NAFAP?

    Hi,
    At the moment I am working on custom Depreciation Key for which the depreciation for period (and subperiods) will be recounted and taken into account for depreciation posting.
    I try to use exit AFAR0002 for this purpose.
    I am able to count and change the value of depreciation for each subperiods. The problem is, that I cannot change the value of "Ordinary depreciation that is planned for the asset in the current fiscal year" for the pierod '000'. Due to this, in the last period of the current fiscal year system tries to reverse the sum of planned depreciation in previous subperiods. It simply tries to meet the "planned depreciation for fiscal year' with the sum of planned depreciation for subperiods.
    example:
    ANLC-NAFAP = 100.
    Active Asset value = 1000
    Depreciation for periods:
    001     ->     -50
    002     ->     -50
    003     ->     -50
    004     ->     -50
    005     ->     -50
    006     ->     -50
    007     ->     -50
    008     ->     -50
    009     ->     -50
    010     ->     -50
    011     ->     -50
    *012     ->     450
    planned value -> -100
    The questions are:
    1. is it possible to change value in ANLC-NAFAP in this exit
    2. How it sould be done.
    Thanks in advance for help.
    Regards,
    Wojciech

    Dear Paul,
    I had run AFAR. The report changed to '0' the value of ANLC-NAFAP  field - sth changed - thanks.
    But I still have a problem to set this value to the sum of planned depreciation for each month. At the moment, in the last period the system tries to reverse all planned "sub"depreciation to '0' in total.
    Is it any additional condition that has to be fulfilled in order to change the value of "Ordinary depreciation that is planned for the asset in the current fiscal year" for the pierod '000'?
    Regards,
    Wojciech

  • How to change value in BADI

    I want to change value of field afnam based on the following code below in BADI ME_PROCESS_REQ_CUST.
    But this code give me endless loop.  Is there anything missing in my coding?Please correct me, Thank you.
      data : obj_pr type MEREQ_ITEM,
             wa_eine type eine.
    CALL METHOD IM_ITEM->get_data
    RECEIVING
    re_data = obj_pr.
      if obj_pr-infnr <> space.
        select single * into wa_eine from eine
        where infnr = obj_pr-infnr.
        if sy-subrc = 0.
          obj_pr-afnam = wa_eine-effpr.
        endif.
      endif.
    CALL METHOD IM_ITEM->set_data
    EXPORTING
    im_data = obj_pr.

    Hi Jessie,
    As per my understanding, the thing is that, in BADI  "ME_PROCESS_REQ_CUST", there is a method called "CLOSE".
    you have to implement this method to close the processing....
    work on triggering the method first and if it triggers, then implement the coding and see how it is working....
    thanks,
    Vishnu.

  • How to change value of element and update XML file

    Hi
    I have an xml file called test.xml like below
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
         <userName/>
         <viewName/>
    </printing>I want to change value of user name and view name and update test.xml file in my folder
    Anyone has sample code to do so
    Ashish

    Thanx
    i was able to do so, but what i want now is to remove element
    for example
    i have following xml
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
              <firstLineText />
              <firstLineText>|line11</firstLineText>
              <firstLineText>|line12</firstLineText>
    </firstLineTexts>
    </printing>how do i remove all elements fireLineText
    my final output should be
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
    </firstLineTexts>
    </printing>How do i do it using DOM,
    I can create instance of DOM and write it using TransformerFactory
    Ashish

  • How to change value date from posting date to net due date

    Hi Gurus,
    My client wants to change value date from posting date to net due date. currently posting date is considered as value date but in future client wants to change value date to net due date of documents.
    1. what configurations need to be maintained to change value date from posting date to net due date.
    2. Will these changes effect automatic payment run.
    Thanks and Regards,
    Suresh

    Hi Suresh,
    In Future
    While posting the documents you can mention the value date as due date of the documents.
    For already posted documents
    You can change the value date to net due date.
    If the value date is display mode i.e. if you are not able to change the value date in FB02 (Document Change Mode), use OB32 transaction and make value date field as eidtable (BSEG-VALUT).
    In OB32 transaction enter all the required fields like Account type, transaction type, company code and finally activate the Field can be changed check box.
    But not sure, whether we can change the value date to previous date or not?
    This would help you..
    Regards,
    Praisty
    Edited by: Praisty on Jul 28, 2009 9:56 AM

  • How to change values in table TPFID (Description of SAP instance)

    I am having problems with my system - I noticed that table TPFID has the incorrect HOST settings, but I can;t figure out how to change this.
    Any advice would be very appreciated!

    That is your operation modes in RZ04, just delete the invalid host from the list and then go settings -> based on current status -> Existing instances ->set
    Regards
    Juan

  • How to change value of auto reload

    Hi, I want to cahnge the amount charged to my credit card when I do a reload or make a payment.  It is currently set for $16 and I want to make it $8 or $10.  I can't figure out how to change the amount, how do I change the amount billed to my credit card?

    Hi,
    When an XML payload is written to a file \n would be used as the default line separator regardless of if its windows or linux, as per the XML specification http://www.w3.org/TR/REC-xml/#sec-line-ends.
    As such, one need not worry about the line separators because, the XML file would eventually be processed by a parser which usually would be able to understand both line endings (as they are whitespace characters as far as the parser is concerned).
    If you want to convert the line terminators (for readability etc), 10.1.3.4 has a new feature - in the XML schema definition for the file adapter payload, add these two top level directives to the schema element:
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    nxsd:normalizeLineTerminators="false"
    Regards,
    Shanmu.

  • How to change value date field

    HI,
    After posting the transaction data into the document , is it possible to change the 'value date' . if it is possible pl.give me guidelines . As i know it is possible to change "Assignmentand Text filed"
    This is my user Requirement to change " Value date field".
    Regards,
    Prabhakar

    Hi,
    Check in document change FB02.
      It may allow you to change the value date. If it is not allow to change the filed then create value date in
      Document Change Rules, Document Header.
    Regards,
    Sankar

  • How to declare value null to object at the end of jsp page.

    Hi
    I have two doubts.
    1. Im getting request from request.getParameter() method. i stored that value in one object. after process completion i have set null value to object at the end of jsp page.
    2. I declare jsp scriptlet within the javascript. in that jsp scriptlet i set session.setAttribute() values. i want to get the session.getAttribute value after javascript code completion.
    i tried but i got jasperException.
    please help me to solve this problem
    Thank u in advance

    Hai Sundaram,
    when ever u got the param from request at that time only u set the same parameter to null..
    i am not sure abt this is my idea only

  • How to change value separator for html_Get function?

    I have application process, which gives invoice related information (date, amount,number). I run this process using html_Get function. Problem is with invoice amount. In polish localization decimal separator is comma (,). Then for an invoice issued today with value 1100.20 with number AA1 process returns: 2010-07-01,1100,20,AA1. It seems to be 4 values instead of expected 3.
    Is it possible to change value separator to ';'? Or maybe there is another solution for this problem.
    regards,
    Krystian

    hmmm join(separator) function     
    Joins together all the elements in an array to produce a single string. If no separator argument is passed through a comma is assumed.
    <script type="text/javascript">
    var scripts = new Array();
    scripts[0] = "PHP";
    scripts[1] = "ASP";
    scripts[2] = "JavaScript";
    scripts[3] = "HTML";
    var str=scripts.join(" : ");
    document.write(str);
    //document.write(scripts.join(" <br> "));
    </script>
    had to do research myself and found this, don't know if this will help you out tho..

Maybe you are looking for

  • Running Windows from external USB HD

    Will Leopard's bootcamp let me install Windows (Vista or XP, any) on an external usb HD? I've seen posts in other forums that it can be done with bootcamp from 2006, but it's rather complicated.

  • Start Cycle in IP02 FOR QM

    Dear Sir/Mam I had created maintenace plan and now i want to change its start date,but when i m going to ip02 there no start date to be changed can u guide. regards kunal

  • Urgent ( Report errors ...............................)

    Hi, after installing 9iAS R2 (9.0.2.0.0) on Sun Solaris 8 with all necessary patchs. i try to run the report demo form the url : http://9iashost:7778/repdemo/examples/Tools/runJSPIAS.html ( the Test a JSP Web Report ... link) i received 500 Internal

  • How to set "same relative location" as default

    Currently my default is set "current users desktop" but can I change this setting to "same relative location so each time I open ARD I don't have to change this? Thank you, todd

  • .ai to .png batch processing

    Hello! I have 1500+ .ai files that I need to automate a batch processing of. Tried recording an action in PS, but it somehow doesn't work. Log file gives me this error message: "Error: The command "Image Size" is not currently available. (-25920)". T