Issue with creation of a specific field for a java program.

Hey everyone,
This is homework which is end of chapter "challenges" to practice what we've learnt.
The chapter covers inheritance (super class and all things related)
I'm having quite an annoying issue with the very beginning of the instructions, where it tells me to make the following fields:
- Employee name
- Employee number in the format XXX-L , where each X is a digit within the range 0-9 and the L is a letter within the range A-M.
- Hire date
This is what I wrote for code so far
private String name;
//private WTF
private String date;I really have no idea what to do for the second field, how to even constrain integers and letters in the same field with a rule for number range and letter range, and that for each character independently, for what I understand.
Any advice with this? It's blocking me from continuing -_-, because I can't make accessors and mutators and constructors, etc, if i'm still unsure of how the fields unfold.
Thanks in advance.

You can create a HireDate class.
public class HireDate{
   private final int day;
   private final String month;
   private final int year;
   public HireDate(int day, String month, int year){
      this.day = day;
      this.month = month;
      this.year = year;
}In the HireDate Constructor you could put if statements to ensure that only correct information is present. The fields are final because the hire date will not change. Override the toString() method so that when you print it out it will be in the correct format. Create some getter methods to get the private fields.
Then in your other class just do this
HireDate hired = new HireDate(10, July, 1991);Now you have an object that stores all 3 fields for you. You can use the object as you like and when it prints it will be in the format you want.
Or you could just make hireDate a String variable. That is what I always did and I never lost marks for it. The reason I suggest this way is because you mentioned rules and constraints.

Similar Messages

  • Creation of a .exe file for a Java program

    hi, myself is venu.
    Can anyone help in creating a .exe file for a generated .class file.
    Thanking you in advance.
    bye

    Hello,
    There is a tool that you can download called JavaExe. It will make an executable of your java class. The class must have a main method. Just google for it and follow the instructions. I have tried it, it does work well.
    delaware_samurai

  • Delta Specific Field for LTAP

    Hi guys,
        I tried using Field EDATU – Date of Pick Confirmation (First Step) as Delta - Specific Field for one of my View Datasource on Table LTAP.
        However no DELTA's recieved for the past one month
        Can someone suggest another field in table LTAP that I can use.
        Thanks

    Hi Chris
    I have the same issue and have not found a suitable field. Now I am doing a full load with a routine selection on a combination of QDATU and EDATU into an DSO and have a delta from the DSO to the cube. If you get sorted with teh delta, please post the solution...
    Cheers
    L.

  • I have a issue with my mac book pro. For some reason it won't stay powered on. I can't get past the apple loading logo. The battery is fully charged so it is not the problem. Can anyone tell me what the problem may be and how can i get it resolved?

    I have a issue with my mac book pro. For some reason it won't stay powered on. I can't get past the apple loading logo. The battery is fully charged so it is not the problem. Can anyone tell me what the problem may be and how can i get it resolved?

    The battery is fully charged so it is not the problem.
    What happens when you use the MagSafe?

  • I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the app does not accept the change, and automatically enters its own time. Am I doing something wrong?

    I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the application does not accept the change, and instead automatically enters its own time. Is there a work around this? Or am I doing something wrong? Please Help!
    Thank you,
    lagrl

    Have you tried turning off automatic transitions ? Choose file - project properties and follow the dialogue box to change duration with a slider.  iMovie also doesn't allow a transition to be more than 50% duration of the clip its attached to. In other words if the clip is 4 seconds the transition cannot be more than 2 seconds and remember that relates to the first clip as the following clip (right side) is pulled back to overlay it.
    Does this help.  Perhaps you already know this ?

  • Issue with activation.  It is asking for a serial number but I have a product key

    I am attempting to activate my adobe acrobat and it is asking for a Serial #, However it will not allow me to enter the alpha-numeric product key.

    I finally figured mine out. 
    The fact that they don't have phone support is incredible to me.
    In a message dated 4/21/2015 4:17:02 P.M. Eastern Daylight Time, 
    [email protected] writes:
    Issue  with activation.  It is asking for a serial number but I have a 
    product key
    created by krystalg31319208
    (https://forums.adobe.com/people/krystalg31319208)   in Acrobat Installation & Update Issues - _View the full 
    discussion_ (https://forums.adobe.com/message/7460080#7460080)

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • Process name representation in a LINUX machine for a JAVA program running..

    Hi,
    We are using an Intel machine loaded with Red Hat Linux 7.2 OS to run JAVA programs. We have a requirement to calculate the CPU and MEMORY usage for each JAVA program running. Unfortunately when a java program is run say "java ESR" and we run a ps -ef | grep -i java, it is shown as hkumar 2847 2799 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2874 2847 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2875 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2876 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2877 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2878 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2879 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2880 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2881 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2882 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2883 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2884 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2885 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    instead of the actual name of the program ie. ESR.
    Does anybody know why this happens? Is there a way out to ensure that "ps -ef | grep java" gives the actual name of the java program being RUN?
    Thanks in advance,
    Harish

    You have less chance to identify which programm that VM instance is running right now.
    But you could (as we do) keep track of your programs if you save the process-id when you start the program.
    We need this to shut down running java batch programs but you could find out the used system resources with this way as well...

  • Issue in Creation of new Value Field in CO-PA

    Hi,
    I have a query in CO-PA Value Field Linking.
    In my Development Client,
    1. Created a New Value Field (No Transport Request Generated)
    2. Linked to the above to new Conditon type created in SD. (Tranport request was generated) i.e. in Flow of Actual Values->Transfer of Billing Documents->Assign Value Fields
    However then i try creating a new Value Field in my Production Client it throws a message 'You have no authorization to change Fields".
    Is this an issue with authorization or i need to transport the Value field too from Development to Production client.
    Please Advise.
    Thanks in Advance,
    Safi

    Thanks Phaneendra for the response.
    The creation of Value field did not create any tranportation request. Will this too be transported if i transport the Operating Concern.
    Please Advise.
    Thanks,
    Safi

  • Issue with Duplicate Results and Summary Fields

    My report is based on an Access Database. For the purposes of this current issue, there is the Master Table called u201CCnu201D and then a related u201CTable Au201D which includes multiple records related to the Master and also a related u201CTable B,u201D also with multiple records related to the Master.
    For my report, I want to output results from Table B based on criteria in Table A. This naturally produces duplicate output on the report. As a result, the Summary Fields that I want to include are incorrect.
    I have tried multiple combinations of the Select Distinct function, suppression based on u201Cprevious fieldu201D being equal, summary fields, running totals and if-then statements and still cannot find a solution that works in all of the cases involved.
    Below are descriptions of three different scenarios that are occurring:
    EXAMPLE #1: Entry 1 has 2 records in Table A and 2 Records in Table B so "Select Distinct" including the Table B ID # and then a Summary Field for the Total produces the correct results, while a Running Total is Incorrect.
    EXAMPLE #2: Entry 2 has 2 records in Table A and 1 Record in Table B so a suppression formula of the field based on the "Previous =" Table B ID # and the Running Total produce the correct results, while Summary Field is incorrect.
    EXAMPLE #3: Entry 3 has 6 records in Table A and 6 Records in Table B. Neither Summary or
    Running Totals produce correct results.
    I would greatly appreciate any advice in terms of creative formulas, etc. that would help produce correct results here.
    Iu2019ll be pulling my hair out soon! Thanks so much-

    Hi Berry
    Try to create a command with a subquery. The subquery will be returning the the duplicate records and the main query that uses this subquery will find distinct records out of the resultset returned by the subquery.
    Let me know if this helps.
    Regards
    Nikhil

  • Issue with length of form text fields in Firefox in OSX

    I've just spotted an issue with this in a page on a site, with two forms next to each other. (the limited space has highlighted it.)
    Basically FF on the Mac is making the text fields longer than any other browser :
    http://www.goodsafariguide.com/trade/loginfail2.php
    If anyone knows a fix for this, that would be great.
    If not, I'll just reduce their length so that at least they're not squashed in any browser (even though they'll be a bit short in every browser other than FF Mac).
    http://www.goodsafariguide.com/trade/loginfail2.php
    Thanks.

    Thanks guys - its just not something I've really noticed before, as most forms I do have enough width compared to this page where I have two side by side.
    Will pop that bit of CSS in.

  • Pb with populating newly added AD fields for existing users

    Hello,
    Let's say that we have version 10 of the AD process form pushed to production.
    Then we decided to push version 11 of the AD process form, which now has 4 more fields, to prod.
    For new users, we can see that the new fields are populated and the data flows down to AD.
    But, how do things work for existing users with existing AD account?
    How can we make the new fields appear in the process form of an existing user with old AD account that did not contain the new 4 fields.
    Thanks
    Khanh

    FVC or Form Version Control Utility is specifically designed for this purpose. Refer OIM documentation & also have a look at the following links:
    http://download.oracle.com/docs/cd/E10391_01/doc.910/e10363/appc.htm
    http://oim-iam.blogspot.com/2010/04/oim-fvc.html
    Thanks
    SRS

  • Delta-Specific Field for Generic DataSource

    Hi,
    I have defined a Generic DataSource for Transaction data on R/3-Side.
    This DataSource is based on View/Table EKKO (Purchasing Document Header) for some specific customer requirements. Delta-Specific Field is AEDAT (Calend. Day). Safety Interval Upper Limit is set 1 Cal. Days. No Safety Interval Lower Limit has been defined. "New Status for Changed Records" has been marked.
    When we see this DataSource in Extractor Checker (RSA3), this data source
    Extracted all delta data where AEDAT is not blank.
    When I see the content of table EKKO, I can find few records where AEDAT is blank.
    These records are missing in Extractor Checker.
    How I can solve this problem? Which delta-specific field can be used in
    this generic Datasource? Should I define an additional Generic DataSource with
    Delta-Specific Field BEDAT (as BEDAT is filled when AEDAT is blank in table EKKO)?
    Thanks for the answer.

    Delta based  on calday wont pick all the records  which are recently posted and you can not run the delta more than one time in a day ,end of the day only you can run the delta.
    Set the delta as Tme Stamp and specify the Upper  limit to 5 minuts.
    We can run the delta no. times and pick the documents posted in short interval of time.
    With Regards,
    Kishore.

  • Issue with creation of COPA document

    Hi
    Can you please look into the following scenario and provide inputs on the issue
    Single Finished Material Number in SAP for both plant
    Plant 1 (Co Code 1000)u2013 Trading Material
    Plant2 u2013Co Code 2000) Manufactures Material
    Plant 2 manufacture Material and sell it to plant 1 and plant 1 sell it to third party. How can we create the COPA document at the time of billing (OTC) for plant 1
    We do nt want to run the Std Cost Estimate for Plant 1.
    thanks in advance
    kind regards
    sap student

    Hi
    If this scenario is applicable always i.e. Plant 2 will always make and Plant 1 will always sell, then you dont need to release cost estimate in Plant 1
    1. Maintain Price Control V in Plant 1 so that it will accet the Std Price of Plant 2 whenever you do the GR
    2. Create a Costing Key in Ke40 and specify the cost estimate Plant = PLANT 2... DO NOT check the radio button "use line item plant as cost estimate plant)... With this, whenever billing hapens from Plant 1, it will pick the Std cost of Plant 2
    br, Ajay M

  • Issue in creation of level 2 WBS for level 1  WBS which is released

    Hello All,
    I am trying to create a level 2 WBS for a alrealy created level 1 WBS using BAPI_BUS2054_CHANGE_MULTI .If the level 1 WBS is not released then level 2 WBS gets created .However if the level 1 is released then level 2 WBS doesnt gets created and i get error ' User status INIT is active (WBS #1) '
    Using T-code CJ20n i am able to create level 2 WBS for released level 1 WBS .

    Hi;
    Do you fill WBS_LEFT, WBS_UP fields for IT_WBS_ELEMENT / IT_UPDATE_WBS_ELEMENT tables.
    Hierarchy is very important for between WBS.
    May help below similar link:
    Re: Create Whole Project with BAPI_PROJECT_MAINTAIN
    Best regards.

Maybe you are looking for