If I wanted to increment a number

I want to increment a student number in a constructor. What is the best way? I have to call this from a display method. Here is what I have so far:
    int     stuNo;
    private static  int     studentNumber  = 100;
    public Student()
        getStudentNumber();
     *  Sets the studentNumber attribute of the Student object
    public void setStudentNumber()
        stuNo = studentNumber + 1;
     *  Gets the studentNumber attribute of the Student object
     *@return    The studentNumber value
    public int getStudentNumber()
        return stuNo;
    }With this code I keep getting the same number(100) for my display. Any help is looked upon in great admiration.

public class Student
int stuNo; // this should probably be a final field
private static int studentNumber = 100;
public Student()
stuNo = studentNumber++; // increments static field
// studentNumber
* Sets the studentNumber attribute of the Student
* object
public void setStudentNumber(int stuNo)
// You probably do not want a modifier on an
// autoincremented field, since it is like an
// primary key???
this.stuNo = stuNo;
* Gets the studentNumber attribute of the Student object
*@return The studentNumber value
public int getStudentNumber()
return stuNo;

Similar Messages

  • Increment the number with date/time string. when ever the next date come's it should reset again with initial number

     i want to store the number of records in a file. Every time when ever i run the program the record will be incremented well i using forloop with count value 1 as a constant .in the for loop i am using autoincrement with the  feedback node . to view the number i have attached the indicatator .the number will be increment every time . i am using number to time time stamp  that is connected to get date/time string. from that we can view the date string and time string . so , my issue is when ever i close the code again it is coming with intial value . i should get from that number only where ever i close the code . after the date completed again it should come from intial value . i am attaching the code so that u guys can solve my problem.
    Attachments:
    record.doc ‏34 KB

    here you can see.......the file path in case structure in that i have included my requirement of increment the number 
    -> if the case is true then it goes in ok file path and the no of records string will pass in the file by seeing these code u will get the clarity
    my requirement is the number of records should increase ........ whnever the program runs...that i made it. by the next day again it should begain with the intial value.........that is my requirement. i hope u understand .
    suggest me how can i use the  intial  value .......
    Attachments:
    code.vi ‏35 KB

  • Increment a number without using sequence in Mapping

    Hi,
    Is there anyway to increment a number without using oracle sequence generator in OWB? I am using version 10.2.0.4.
    Please let me know.
    Thanks,
    Siva

    Perhaps it would help if you were more specific on what you wanted to do. I mean, there are many ways to generate sequences of numbers in Oracle. For example:
    select level as seq_num from dual connect by level < 100;
    to get the integers from 1 to 100. If you are dealing with order of rows within subsets of a query, take a look into analytic functions like rank().
    But "Ways to increment a number"? Sure:
    create function increment( x in number) returns number is begin if x is not null then return x+1; else return null; end if; end;
    Now call your increment function!
    Not sure what you are trying to accomplish, and can't help much without knowing.
    Sorry.

  • How to generate an incrementing batch-number per set number of rows

    Hi,
    How could you generate an incrementing batch-number per set number of rows for a table in SQL?
    The returned result set of the SQL query should show a preceding batch number per row set and incremented by 1 for the next row set.
    Eg, you want to start the batch_number by 1 for the first three returned rows of the table and than increment by 1 for the next three rows.
    The result set would look like:
    BATCH_NO, TAB_COL1, TAB_COL2, TAB_COL3, TAB_COL4, ..
    1, ...
    1, ...
    1, ...
    2, ...
    2, ...
    2, ...
    3, ...
    3, ...
    3, ...
    etc.
    Cheers.

    Many thanks guys, I would have never thought about these options.. Yes the reason for adding the preceding batch number has to do with migrating data from a source table where we only can grab small sets of rows at the time to bring across to a target table.
    Cheers.

  • Create Auto increment sequence number for list view report

    Hi All,
              Am using BAM 11.1.1.6 version, Have updating list report & wants to create auto increment sequence number at report level. Is it possible to create column at run time in BAM reports.
    Please help.
    Thanks.

    Hi All,
              Am using BAM 11.1.1.6 version, Have updating list report & wants to create auto increment sequence number at report level. Is it possible to create column at run time in BAM reports.
    Please help.
    Thanks.

  • Autofill not incrementing a number pattern

    I've seen how autofill is supposed to work once you start a pattern in a table. From what I've seen, it is supposed to increment a number pattern in the following cells.
    So if I entered 1,2,3,4, in the first 4 cells, in the next 4 cells, auto fill would enter 5,6,7,8.
    However, instead, I am jut getting a repeat of the original pattern, over and over, 1,2,3,4, 1,2,3,4, 1,2,3,4,
    I couldn't find any preference to change this behavior.
    Any ideas?
    Thanks,
    Richard

    Okay Richard, I have found out why mine was not working...
    It seemed my column was not formatted as Automatic. It was initially formatted as Text, see here:
    So, I tried just highlighting the cells I wanted the incrementing to occur in and set them to "Automatic" in the format. Then I tried to pull the handle down and I still ended up with the repeating 1 2.
    So, then I decided to try formatting the ENTIRE column as Automatic. I clicked the "A" column to select the entire column. And then realized that it had some formatting issues because the Format selection was blank, like in the following screenshot:
    I went ahead and selected "Automatic" for the ENTIRE column.
    And then I tried the incrementing, and it worked!
    Hopefully this fixes your issue as well! Good luck!
    Jen

  • In FBL5N report user wants the sales document number to be displayed,

    HI, Guys
    Need ur help to sort out the problem
    In FBL5N report user wants the sales document number to be displayed,
    but the sales ducument number column is coming blank and this needs to pick from VBRP table
    As I discussed with Abaper, he reqiures a key field which common in BSEG abd VBRP table
    So,Please guide me in approaching the right way
    Munender

    Hi,
        Speak with your SD consultant. They can set up the copy control in SD so that the sales order is populated in the invoice in field ZUONR (Assignment).This will then copy to the assignment field in accounting.
    Alternatively you can use an exit to populate another field during the Posting.
    Kind regards

  • Hi want to convert a number in crore, e.g. 10000000 to 1.00 Can anybody help on this?

    Hi All,
    I want to convert a number in crore format.
    My basic problem is, I am using a custome format:
    #,##0.00,,,%;
    Here main task is done by ,,,%.
    Each comma (,) is dividing a number by 1000. Thus three commas are dividing a number by 10^9 digits.
    But I need number in crore (i.e. 10^7), Thus we have used this percent sign (%).
    Here I can get required Value but appended percent (%) to it. I can temporary hide this using wrap text.
    But I need exact solution to convert a number in crore.
    Can anybody help me regarding the same.

    Hi Neha,
    You can use EPMScaleData function, in that give scaling factor as per your requirement.
    For more details you can go through following link
    How to use EPMScaleData in a fully dynamic report
    Regards,
    Shrikant

  • Hi, I want to use my number for iMessage on my iPhone only and on my macbook pro use my apple id/email and not my number. Also how do i stop the iMessages on my mac appearing on my phone.

    Hi, I want to use my number for iMessage on my iPhone only and on my macbook pro use my apple id/email and not my number, how do i do that? before i updated my phone thats what it was like but now that ive updated i dont know how to change it. Also how do i stop the iMessages on my mac appearing on my phone. can you please help. Thanks

    I tried that but on my iphone i can only click on my email and my number is checked but its in grey doesnt allow me click on it and on my Mac, its the opposite, my email is checked but in grey so doesnt allow me to click on it. im realy confused

  • ABAP Query - Want to limit the number of records to 5

    I have a query based on a a table join (MKPF with MSEG) infoset. I want to limit the number of records to first five.
    How to deal with it?

    select data from tables using join and where conditions....into internal table....
    now move the first 5 records to second internal table and use them...
    or else in ur select statement u can use...
    select  data from tables <join condition> upto 5 rows.
    Message was edited by:
            Ramesh Babu Chirumamilla

  • ALL I WANT IS MY ACCOUNT NUMBER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I have been calling I cant reach a ******* human, Ive been all over this website. All i want is my ******* account number!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    First off knock off the all caps.
    Secondly we don't work for verizon wireless so we have no idea what your account number is.
    I told you to read your invoice, let me guess you don't have paper billing ?
    In that case you either log into http://www.verizonwireless.com (this site) you need to know your phone number, and your My Verizon password or you have to register.
    Then click on My Bill and your account number is there. Or as Tiki said if prepaid its your telephone number.
    Good Luck

  • In contacts that i have sync from my computer, i want to dial a number which is in notes

    in contacts that i have sync from my computer, i want to dial a number from  notes

    Tap on the number in the notes section and a menu should pop up that include Copy. Tap Copy, then either paste into one of the phone numbers in the contact, or paste into the dialpad (to paste tap once in the field and a menu will appear).

  • I want to display the number of Passed / failed tests in Testtand xml report , please help me

    Hi, I want to display the number of Passed / failed tests in Testtand xml report , please help me.
    My requirement is later i should be able to display these number of passed/failed test in report header too.
    Solved!
    Go to Solution.

    I have attached a sequence to give you an idea of how to get the Result count (I didn't check it's working ), I have used "SequenceFilePostResultListEntry" callback to calculate the Result Count,
    and the Result Count is passed to the "ModifyReportHeader" through File Globals,  where you can edit the XML file to show it in the Repot (follow the link in my previous post).
    Hope this helps
    AshwiN,
    Attachments:
    Get Result Count.seq ‏8 KB

  • I want to see a number with the name when one of my contacts calling me.., i just see his name...i am from egypt there is a problem with a country

    i want to see a number with the name when one of my contacts calling me.., i just see his name...i am from egypt there is a problem with a country

    If someone who is listed in your contacts calls you, you will only see their name. This has nothing to do with the fact you're in Egypt. The only workaround I can see for this is to put the person's number in the name section of the contacts. In other words, put their first and last name in the first name section and their phone number in the last name section.

  • Don't want my skype in number

    Hello, I purchased a Skype Number today for three months and wnat to cancel it and get my refund.  How do I do that?  All I see is how to do that for a subscription. I purchased it today, but I didn't get the email because it went to an old email that I know longer have.  I called in to the number twice seeing how it worked, but I we don't want to maintain a number and I didn't see any other way to just try it out.  Thanks fo ryour help!

    Hi, Jungheinrich, and welcome to the Community,
    What you describe is how I have my Caller ID set up, and it works for me - I am in the USA.  Here is a link to the library of FAQ articles related to Caller ID, so you can peruse and make an informed decision - I do not know if Caller ID is upported in your location.
    https://support.skype.com/en/category/CALLER_IDENTIFICATION/
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

Maybe you are looking for

  • Garbage Collection Advice

    We currently have a garbage collection related performance issue that I could do with some advice on. We use Jakarta Tomcat with an application that has approximately 1300 jsp's. When a new set of jsp's are rolled out we see a degradation in performa

  • IWork with Yosemite on iMac

    hi: I upgraded to yosemite on my mid 2011 iMac... Does anyone know if iWork is supposed to be included with this upgrade... because if it is, i don't have it anywhere on my system. And what should i do to get it? Thanks

  • Implementing Search Filed in apex 4.1

    Hi All, I am new to APEX I have an application, which is based on SQL query. For that apllication i want implement a search function based on particular column. For Ex: I have name column in the application, So in the search text filed when i any typ

  • How to Select Discontnuous Dates

    I am building an Window form application using Visual C#, I need to provide an interface for users to select dates; the dates selected can either be a single date, such as, 03/14/2015, a range of continuous dates, such as, 03/01.2015-03/31/2015, or a

  • Downloaded files from Apple store are in completely wrong order

    I downloaded Bach's Goldberg variations from Apple store. It is a 30-track piece, and the order is completely garbled. Manually rearranging it is a tedious task with frequent mistakes. Any quick was to do this ??