How to get GregorianCalender attribute to print out the year  monthandday

public class PetStay
private Pet Pet;
private String ownerName;
private String ownerNric;
private GregorianCalender checkInDate;
private GregorianCalender checkOutDate;
private int checkInId;
private BathingService service1;
private DefleaingService service2;
public PetStay(Pet p, String oName, String oNric, GregorianCalender ciDate, int ciId)
this.pet=p;
this.ownerName=oName;
this.ownerNrice=oNrice;
this.checkInDate=ciDate;
this.checkInId=ciId;
public int getStayInId()
getStayInId=ciId;
public void setCheckOutDate(int year, int month, int day)
Here's the code I have so far, pardon my noobiness.
Thanks

alright thanks but how do I enter the date manually?
and if type this
public GregorianCalender CheckInDate, is it correct?Calculating Java dates: Take the time to learn how to create and use dates - http://www.javaworld.com/jw-12-2000/jw-1229-dates.html

Similar Messages

  • How do I  print out the attributes of objects from a  Vector?  Help !

    Dear Java People,
    I have created a video store with a video class.I created a vector to hold the videos and put 3 objects in the vector.
    How do I print out the attributes of each object in the vector ?
    Below is the driver and Video class
    Thank you in advance
    Norman
    import java.util.*;
    public class TryVideo
    public static void main(String[] args)
    Vector videoVector = new Vector();
    Video storeVideo1 = new Video(1,"Soap Opera", 20);
    Video storeVideo2 = new Video(2,"Action Packed Movie",25);
    Video storeVideo3 = new Video(3,"Good Drama", 10);
    videoVector.add(storeVideo1);
    videoVector.add(storeVideo2);
    videoVector.add(storeVideo3);
    Iterator i = videoVector.interator();
    while(i.hasNext())
    System.out.println(getVideoName() + getVideoID() + getVideoQuantity());
    import java.util.*;
    public class Video
    public final static int RENT_PRICE = 3;
    public final static int PURCHASE_PRICE = 20;
    private int videoID;
    private String videoName;
    private int videoQuantity;
    public Video(int videoID, String videoName, int videoQuantity)
    this.videoID = videoID;
    this.videoName = videoName;
    this.videoQuantity = videoQuantity;
    public int getVideoID()
    return videoID;
    public String getVideoName()
    return videoName;
    public int getVideoQuantity()
    return videoQuantity;
    }

    Dear Bri81,
    Thank you for your reply.
    I tried the coding as you suggested
    while(i.hasNext())
    System.out.println( i.next() );
    but the error message reads:
    "CD.java": Error #: 354 : incompatible types; found: void, required: java.lang.String at line 35
    Your help is appreciated
    Norman
    import java.util.*;
    public class TryCD
       public static void main(String[] args)
         Vector cdVector = new Vector();
         CD cd_1 = new CD("Heavy Rapper", "Joe", true);
         CD cd_2 = new CD("Country Music", "Sam", true);
         CD cd_3 = new CD("Punk Music", "Mary", true);
         cdVector.add(cd_1);
         cdVector.add(cd_2);
         cdVector.add(cd_3);
         Iterator i = cdVector.iterator();
         while(i.hasNext())
           System.out.println( i.next() );
    public class CD
       private String item;
       private boolean borrowed = false;
       private String borrower = "";
       private int totalNumberOfItems;
       private int totalNumberOfItemsBorrowed;
       public CD(String item,String borrower, boolean borrowed)
         this.item = item;
         this.borrower = borrower;
         this.borrowed = borrowed;
       public String getItem()
         return item;
       public String getBorrower()
         return borrower;
       public boolean getBorrowed()
         return borrowed;
       public String toString()
          return System.out.println( getItem() + getBorrower());

  • How do I get my MX420 to print out a fax that is in its memory?

    How do I get my MX420 to print out a fax that is in its memory?

    Hello notatechie,
    Please try the following procedure to print the documents in memory:
    1. Make sure that the machine is turned on.
    2. Load paper.
    3. Press the FAX button.
    The Fax standby screen is displayed.
    4. Press the left Function button.
    The Fax menu screen is displayed.
    5. Select  Memory reference, then press the OK button.
    6. Use the   button to select Print all received documents, then press the OK button.
    The confirmation screen is displayed.
    7. Use the   button to select Yes, then press the OK button.
    All the documents in machine's memory will be printed.
    Each time a document is printed, the screen to confirm whether to delete the printed document in machine's memory is displayed.
    If you select Yes using the   button and press the OK button, the printed document in machine's memory is deleted.
    We hope this helps!
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    Without actually seeing some of what is in the .ics attachment there's really no way to see what's going on.

  • Before getting a new 5S, I want to print out the iMessages on my old 4S. How do I do that?

    Before getting a new 5S, I want to print out the iMessages on my old 4S. How do I do that?

    Google it - there are 100s of applications that will offload your messages from your iTunes backup file that will allow you to print them out.
    I use iBackupBot.

  • In Numbers '09, version 2.3 (554), how to I get spreadsheet gridlines to print out? I have a Macbook Pro and use OSX 10.9.4 Mavericks.

    In Numbers '09, version 2.3 (554), how to I get spreadsheet gridlines to print out? I have a Macbook Pro and use OSX 10.9.4 Mavericks.

    HP,
    In Numbers '09, the only lines that print are Cell Borders. Apply borders and test by Printing to PDF.
    Jerry

  • How to get all attributes of a component

    Hi all,
    In a component I'm trying to get attributes of some primefaces components, but somehow I cannot retrieve them all.
    Here's a little bit of a table:
              <p:dataTable styleClass="ptable100" title="${msg.contractlist_title}" id="contractlistTable" var="contract" value="#{contractList.contracts}" width="100%" height="200px"
                        emptyMessage="#{msg.all_lists_no_records_found}" paginator="#{contractList.rowSize > 10}" rows="10" rowsPerPageTemplate="5,10,20,50,100"
                        paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}  #{msg.all_lists_numberOfRowsDisplayed_label}{RowsPerPageDropdown}">
                   <p:column id="column_id" resizable="true" sortBy="#{contract.id}" style="white-space:normal">
                      <f:facet name="header"><h:outputText styleClass="headerText" value="#{msg.contractlist_contract_id}" /></f:facet>
                         <h:outputLink value="#{path.dynamicUrl}contract/detail.xhtml" onclick="Richfaces.showModalPanel('busy_nav');">
                             <h:outputText value="#{contract.id}"/>
                             <f:param name="contractid" value="#{contract.id}" />
                         </h:outputLink>
                  </p:column>Then, I try to get the attributes like this (where table is the UIData component):
              String title = "";
              System.out.println("table.getAttribs.keys= " + table.getAttributes().keySet());
              System.out.println("table.getAttribs.vals= " + table.getAttributes().values());
              if (table.getAttributes().containsKey("title")) {
                   title = String.valueOf(table.getAttributes().get("title"));
              }The function getAttributes() is implemented on UIComponentBase so I believe it's independent of the component.
    This prints the following:
    table.getAttribs.keys= [com.sun.facelets.MARK_ID]
    table.getAttribs.vals= [5756abfa]When I do the same for the columns, all attributes I get is MARK_ID, style and styleClass.
    Obviously I'd like to get all attributes, in this case the "title" on the p:dataTable.
    Any thoughts why this isn't working and how I could do that?
    Thank you,
    Steven

    Hi all,
    In a component I'm trying to get attributes of some primefaces components, but somehow I cannot retrieve them all.
    Here's a little bit of a table:
              <p:dataTable styleClass="ptable100" title="${msg.contractlist_title}" id="contractlistTable" var="contract" value="#{contractList.contracts}" width="100%" height="200px"
                        emptyMessage="#{msg.all_lists_no_records_found}" paginator="#{contractList.rowSize > 10}" rows="10" rowsPerPageTemplate="5,10,20,50,100"
                        paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}  #{msg.all_lists_numberOfRowsDisplayed_label}{RowsPerPageDropdown}">
                   <p:column id="column_id" resizable="true" sortBy="#{contract.id}" style="white-space:normal">
                      <f:facet name="header"><h:outputText styleClass="headerText" value="#{msg.contractlist_contract_id}" /></f:facet>
                         <h:outputLink value="#{path.dynamicUrl}contract/detail.xhtml" onclick="Richfaces.showModalPanel('busy_nav');">
                             <h:outputText value="#{contract.id}"/>
                             <f:param name="contractid" value="#{contract.id}" />
                         </h:outputLink>
                  </p:column>Then, I try to get the attributes like this (where table is the UIData component):
              String title = "";
              System.out.println("table.getAttribs.keys= " + table.getAttributes().keySet());
              System.out.println("table.getAttribs.vals= " + table.getAttributes().values());
              if (table.getAttributes().containsKey("title")) {
                   title = String.valueOf(table.getAttributes().get("title"));
              }The function getAttributes() is implemented on UIComponentBase so I believe it's independent of the component.
    This prints the following:
    table.getAttribs.keys= [com.sun.facelets.MARK_ID]
    table.getAttribs.vals= [5756abfa]When I do the same for the columns, all attributes I get is MARK_ID, style and styleClass.
    Obviously I'd like to get all attributes, in this case the "title" on the p:dataTable.
    Any thoughts why this isn't working and how I could do that?
    Thank you,
    Steven

  • How to take sub-contracting challana print out

    Hai friends,
    How to take sub-contracting challana print out.
    Where i have to do the message settings for taking return delivery excise document print out ( rejected RM  material return to vendor ).
    Please guide me.

    Hello,
    During creation of 57F4 Challan in J1IF01, in Basic Data Tab Page, scroll down the screen, you will get a check box of "Print immediately" just activate it before saving, it will print the Subcontracting challan once you save it.
    And to re-print the same go to J1IF11 and activate this indicator again and save.
    Configuration Checks: -
    SPRO > Logistics - General > Tax on Goods Movements > India > Business Transactions > Subcontracting > Subcontracting Attributes > Check whether Subcon Output Type - J1IF is maintained here.
    Also check in M706 - For Output Type - J1IF should be in place.
    Note: - There is no need of maintaining condition record for output type J1IF in MN21 and also no need to do any further configuration.
    Maintain printer in the SPRO - IMG - MM - Inventory management - Output determination - printer determination.- printer determination by plant / storage location ( OMJ3). Here for the application area ME, condition type J1IF, assign the printer.
    regards,

  • How do i print out the keyboard viewer?

    I use different languages and need to use the different special characters so am switching among different keyboard layouts frequently.  I use the (on-screen) "Keyboard Viewer", but would like to print out the "Keyboard Viewer" for each language that I frequently use.  I can't see how to do this other than with e.g. screen capture which is less than ideal.  Does anybody know where there are e.g. images of each keyboard layout (including special characters you get by hitting "shift" etc.)?

    TThis page will give you normal and shift
    How to identify keyboard localizations - Apple Support
    FFor the option and option plus shift levels, you will have to use screen capture

  • How to easily print out the tutorial

    Is there an easy way to print out the entire tutorials that
    are available on the adobe site? It's easier for me to follow a
    tutorial on paper next to me then to open two window on my computer
    screens and follow on the screens. Thank you.

    File > Print ?
    I don't know the tutorials you are talking about, but you can
    print most
    articles. Check for a printer-friendly version. Or, post a
    URL if you
    don't get the answer you are looking for and I'll tell you
    how to print it.
    Tony

  • How to print out the data from the file ?

    hi all,
    i have upload my file to here :
    [http://www.freefilehosting.net/ft-v052010-05-09 ]
    anyone can help me to print out the data from the file ?
    the content of the file should be like this :
    185.56.83.89 156.110.16.1 17 53037 53 72 1
    and for the seven column is
    srcIP dstIP prot srcPort dstPort octets packets

    hi all,
    i have try to do this
    public static void Readbinary() throws Exception
              String file = "D:\\05-09.190501+0800";
              DataInputStream dis = new DataInputStream(new FileInputStream(file));
              //but then how to read the content ??????can you give me more hint ?????
    i have find the netflow v5 structure by C
    struct NFHeaderV5{
    uint16_t version; // flow-export version number
    uint16_t count; // number of flow entries
    uint32_t sysUptime;
    uint32_t unix_secs;
    uint32_t unix_nsecs;
    uint32_t flow_sequence; // sequence number
    uint8_t engine_type; // no VIP = 0, VIP2 = 1
    uint8_t engine_id; // VIP2 slot number
    uint16_t reserved; // reserved1,2
    struct NFV5{ 
    ipv4addr_t srcaddr; // source IP address
    ipv4addr_t dstaddr; // destination IP address
    ipv4addr_t nexthop; // next hop router's IP address
    uint16_t input; // input interface index
    uint16_t output; // output interface index
    uint32_t pkts; // packets sent in duration
    uint32_t bytes; // octets sent in duration
    uint32_t first; // SysUptime at start of flow
    uint32_t last; // and of last packet of flow
    uint16_t srcport; // TCP/UDP source port number or equivalent
    uint16_t dstport; // TCP/UDP destination port number or equivalent
    uint8_t pad;
    uint8_t tcp_flags; // bitwise OR of all TCP flags in flow; 0x10
    // for non-TCP flows
    uint8_t prot; // IP protocol, e.g., 6=TCP, 17=UDP, ...
    uint8_t tos; // IP Type-of-Service
    uint16_t src_as; // originating AS of source address
    uint16_t dst_as; // originating AS of destination address
    uint8_t src_mask; // source address prefix mask bits
    uint8_t dst_mask; // destination address prefix mask bits
    uint16_t reserved;
    but how to translate the structure to java,then get the data from the file ?
    Edited by: 903893 on Dec 21, 2011 10:52 PM

  • How to get result query to print PDF pages, e.g.invoices?

    Greetings
    I have set up the query results to fill an html page with data which is an invoice to be sent out to lesees.
    Using the cfdocument tag, I can get a printable PDF version with the mailing address positioned to show in a window envelope, etc., but only one at a time.
    There is a way to loop through all the records (in this case, over 1000) and print out the whole lot (single page invoices in PDF) with one command, I assume?
    I have looked into cfprint and cfreport, but don't see how these could be used in this situation?
    Thanks for any help with this...

    Copy all 1000 invoces as one PDF document, then print. Something like this
    <cfdocument format="PDF" name="invoices">
    <html>
    <cfloop through query or array or list, and so on, to get each address>
    <!--- Text containing a dynamically generated address goes here --->
    </cfloop>
    <!--- Starts a new page for each pass of the loop --->
    <cfdocumentitem type="pagebreak" />
    </html>
    </cfdocument>
    <cfprint source="invoices" printer="\\s1001prn02\NTN-2W-HP_BW02">

  • How to print out the informations of mp3 for the format of TagContent?

    I can get the mp3 title, but when i try to print it out, it is the wrong code...
    i know the format of title is TagContent .
    But how to print such " TagContent " format by system.out.print?
    Here's my code :
    import de.vdheide.mp3.*;
    import java.io.*;
    public class c
    public static void main (String [] args) throws IOException
    try
    MP3File mp3 = new MP3File("fly.mp3");
    System.out.println( mp3.getTitle());
    catch (Exception e)
    }

    Hello
    If I understand your question correctly, you are trying to print out the indexes where the value in your matrix is greater than 4
    If this is the case, then what you need to use is nested for loops e.g.
    for (int i = 0; i< array[0].length; i++)
    for (int j = 0; j< array[].length; j++)
    int value = array[i][j];
    if (value > 4)
    System.out.println("The pos is (" + i + "," + j + ")" );
    Regarding the syntax I have used to get the size of the array, I am not sure if this is correct, but you should have an idea of what I am doing.
    Sajid

  • How to print out the position of 2 dimension arrays?

    there are 2 dimension arrays, how can print out the position of value than 4?
    for example
    0 2 3 2 2 2
    0 1 1 2 5 3
    1 2 3 3 2 1
    print out:
    The pos is ( 5,2).

    Hello
    If I understand your question correctly, you are trying to print out the indexes where the value in your matrix is greater than 4
    If this is the case, then what you need to use is nested for loops e.g.
    for (int i = 0; i< array[0].length; i++)
    for (int j = 0; j< array[].length; j++)
    int value = array[i][j];
    if (value > 4)
    System.out.println("The pos is (" + i + "," + j + ")" );
    Regarding the syntax I have used to get the size of the array, I am not sure if this is correct, but you should have an idea of what I am doing.
    Sajid

  • I need to print out the response forms.  How do I do it?

    I need to print out the response forms.  How do I do it?

    They are saved as PDF files, so you just need to install Adobe Reader, which you can download for free: http://get.adobe.com/reader/

Maybe you are looking for

  • Accessible PDF files and forms

    I am beside myself with the lack of help and/or interest in the Accessiblity area. We have been mandated to make all our PDF files accessible on our Web site. We have been able to master many of the issues regarding tags and form fields, but still ha

  • Kernel Upgrade Error :Cannot open or remove a file containing a running prg

    Hello All, I have installed ECC 6.0 on DB2 /AIX and now trying to apply Kernel Patch 75 but after Uncar of SAR files and moving the same to EXE (/sapmnt/PRD/exe) I am nota ble to copy few files, Follwoing error is coming. As a reuslt of this error Di

  • How to delete manually managed songs?

    Hi, I am getting this problem with iTunes 11.0.1.12 (iOS 6.0.2) where for some reason the only way to delete the song is to go to first "On This Phone">Music then select a song or a few of them and press delete on PC. Now its important to mention tha

  • Mac Mini and two IPAD2s

    Hello, I have 2 IPAD2s and a Mac Mini.  I have tried all morning to link the 3 of them together wirelessly to share the same data.  Basically, this is for a home-based small business and the 2 Ipads will be used in the field to write invoices that wi

  • How to display uploaded jpeg in jsp

    hi all, i am uploading image(jpeg) using FormFile in .............. then i am trying to display into the jsp but its display bytes only........... my code is as below jsp <html:form action="/viewImage.do" method="post"     enctype="multipart/form-dat