Some quick assistance please...

import java.util.Calendar;
import java.util.GregorianCalendar;
public class DateProject
     public static void main(String[] args)
          GregorianCalendar cal = new GregorianCalendar();
          GregorianCalendar eckertsBirthday = new GregorianCalendar(1919, Calendar.APRIL, 9);
          int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
          int month = cal.get(Calendar.MONTH);
          int year = cal.get(Calendar.YEAR);
          int weekDay = cal.get(Calendar.DAY_OF_WEEK);
          System.out.print("Current date: ");
          System.out.print(weekDay);
          System.out.print(" ");
          System.out.print(month);
          System.out.print("-");
          System.out.print(dayOfMonth);
          System.out.print("-");
          System.out.println(year);
          System.out.print("1 day later: ");
          System.out.print(weekDay);
          System.out.print(" ");
          System.out.print(month);
          System.out.print("-");
          cal.add(Calendar.DAY_OF_MONTH, 1);
          System.out.print(dayOfMonth);
          System.out.print("-");
          System.out.println(year);
}Output:
Current date: 2 1-18-2008
1 day later: 2 1-18-2008
Process completed.
Okay, for some reason, the date was not incremented by one day and I'm unsure why. I know the .add method is a mutator so I would think it would mutate the cal reference object but it obviously didn't work... What am I doing wrong? Thanks in advance! :)

Try
int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
          int month = cal.get(Calendar.MONTH);
          int year = cal.get(Calendar.YEAR);
          int weekDay = cal.get(Calendar.DAY_OF_WEEK);
          System.out.print("Current date: ");
          System.out.print(weekDay);
          System.out.print(" ");
          System.out.print(month);
          System.out.print("-");
          System.out.print(dayOfMonth);
          System.out.print("-");
          System.out.println(year);
          cal.add(Calendar.DAY_OF_MONTH, 1);
          System.out.print("1 day later: ");
          System.out.print(cal.get(Calendar.DAY_OF_WEEK));
          System.out.print(" ");
          System.out.print(cal.get(Calendar.MONTH));
          System.out.print("-");
          System.out.print(cal.get(Calendar.DAY_OF_MONTH));
          System.out.print("-");
          System.out.println(cal.get(Calendar.YEAR));

Similar Messages

  • Need Some Quick Assistance with Project Settings

    Hi,
    I'm doing a project that needs to be played back on and HD television set and am creating all the graphics and text myself. I have set the project settings to HD 720p, but am wondering if I should do an output to HD Broadcast 1080i60 (1920x1080).
    Also, since I started the project in HD 720p (1280x720) is there a way to switch the project settings to HD Broadcast 1080i60 while in the middle of the project.
    Any quick assistance would be greatly appreciated!
    Thanks,

    hi,
    don't know what project settings you should use, other than to do the biggest baddest quality your machine can handle. You can always down rez later, you cant up rez ( well you dont gain the extra quality)
    however you can change the project settings by clicking on Project Properties in the edit menu. There you will find pop menus to allow you to change the settings. or you could opena new project and cut and paste layers between the two.
    hth
    adam

  • Some Quick Assistance

    I currently have a macbook from may 2009. The screen is busted but i have it hooked up to a new monitor so i can use it. It has 2gb of ram and runs pretty decent. The question i have is should i upgrade it by getting some more ram and a nice monior and such or should i go get a 21.5 inch imac with 8gigs of ram? Iam currently only just becoming a senior so my summer job should be able to just cover the price. I could use some opinions! Thanks!

    Senior in high school?  If so, are you going to university next year and what subject area will be your major?  That can influence the decision to replace.
    Adding memory and a new monitor to a three year old computer with a broken screen does not seem cost-effective.  If you are going to need true portability for university work you would be better served by delaying purchase until later in the summer and see if Apple will be offering a college discount this year.  In the past they have had some good deals for students.

  • Hi I dont really want to start a discussion but would like some quick advice please!

    I m using a imac 28inch, and recently been working with the creative cloud. my main problem is working with dreamweaver, finding after awhile that if i move the page about it leaves a strobic static effect after , leaving the screen difficult to work with! would this be down to wifi or ram?

    Strobic static effect?
    Do you mean this...
    http://forums.adobe.com/message/5526664#5526664
    It may be due to the use of background-color:transparent in the css.

  • Need some quick help - fairly urgent!

    I've just taken over a new job and have been the task of finishing the new brochure for Christmas, there's not a lot to do but a lot of the measurements need changing
    This is the layout I'm dealing with..
    All the boxes have been made in Illustrator
    The text has been done in In'Design and it seems every piece of text is it's own box if that makes sense
    My question is, if I select the whole specification box - copy, paste it into Adobe Illustrator and change the text there, then paste the edited box back into In-Design, will I lose quality when it gets printed?
    I'm worried if I do it this way it may come out blurred? Or am I just worrying about nothing?

    I couldn't find an Illy file in the end and have ended up creating tables in ID to replicate what was already there!
    Didn't take very long and I guess if I didn't do it now, I'd come across the same situation next time!
    Date: Wed, 30 Nov 2011 08:48:07 -0700
    From: [email protected]
    To: [email protected]
    Subject: Need some quick help - fairly urgent!
        Re: Need some quick help - fairly urgent!
        created by Peter Spier in InDesign - View the full discussion
    There certainly are viable "quick fix" solutions proposed here, and if the dealine is looming and this file never needs to be touched again I might be tempted, but they are only postponing the pain for a file that needs periodic updates, and I wouldn't waste effort on them, myself, when that time can be put toward a proper rebuild now if that's the ultimate goal.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4054725#4054725
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4054725#4054725. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in InDesign by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • To create popup message when user clicks on some quick link or area page

    Hi Experts,
    I have following requirement:
    1) User will login into Portal.
    2) User will be shown ESS / MSS tab pages
    3) User will click on ESS Area Page --> Training Home  or User will click on ESS Area Page --> Training Home --> Some Quick LInk
    4) As soon as user clicks on these links, one pop up message should be displayed to the user. This should contain some information from the R/3
    5) The above pop up message will be displayed if the user fulfils certain conditions (i.e. user has not completed training appraisal).
    How we can achieve this?
    Please help.
    Regards,
    Gary

    Hi Gary,
    Config table T7XSSSERLNK is for maintaining links in the Confirmation screen of ESS. Please look into this table to find out if this is of any help.
    Preetham Roy Aranha

  • Does the Canada ONLINE Apple store sell the unlocked iPhone 5 model "A1429 CDMA"? Need a quick reply please ..

    Does the Canada ONLINE Apple store sell the unlocked iPhone 5 model "A1429 CDMA"? Need a quick reply please ..

    http://www.apple.com/iphone/LTE/

  • Whenever I try to enter my credit card information into iTunes via either my mac book or my iphone it says there is an error and says "for assistance, please contact itunes support, etc...". Can anyone help with this?

    Whenever I try to enter my credit card information into iTunes via either my mac book or my iphone it says there is an error and says "for assistance, please contact itunes support, etc...". Can anyone help with this?
    I haven't had any luck at all getting it resolved using iTunes support so I'm hoping someone who's encountered the problem can help me.

    What did itunes suport tell you?
    They will need to solve this.

  • I keep getting a message to update my flash player, then a screen showing flash player pro appears,  I don't have this on my iPad that I'm aware of. I cannot view videos etc (new to ipad) can anyone assist please.

    I keep getting a message to update my flash player, then a screen showing flash player pro appears,  I don't have this on my iPad that I'm aware of. I cannot view videos etc (new to ipad) can anyone assist please.

    Adobe has not made a version of Flash for the iPad.
    Kappy explains why. https://discussions.apple.com/message/19446567#19446567
    5 Flash Player Alternatives http://www.techshout.com/features/2011/01/flash-player-for-ipad-apps/
    Top 4 browsers supports flash player on iPad and iPhone
    http://mashtips.com/flash-player-ios/
     Cheers, Tom

  • My iPhone 4S screen flash all the time. Like if its locked it turns on. I think some notification pop for some msc. Please HELP!

    My iPhone 4S screen flash all the time. Like if its locked it turns on. I think some notification pop for some msc. Please HELP!

    Basics from the manual are restart, reset, restore.
    Have you tried each of these?

  • After ios 5 update my iphone 3gs stopped writing some letters (t, f, c) and some 5 number. please help. !

    after ios 5.0.1  update my iphone 3gs stopped writing some letters (t, f, c) and some "5" number. please help. !
    and the unlock slider is not working properly, i have to slide many times to open the phone.

    Same problem.

  • I work on the CompactRIO 9068 that the password is lost for some time. Please help me to reset it, for finish my end of study project. Thank you,

    I work on the CompactRIO 9068 that the password is lost for some time.
    Please  help me to  reset it, for finish my end of study project.
    Thank you,

    but the page of ni support does not work:
    https://sine.ni.com/srm/app/newrequest
    and I have the recovery.cfg file from NI with this steps :
    1.        Copy the recovery.cfg file, found in the zip folder attached at the bottom of the email, to the thumb drive. 
    2.        With the cRIO device powered off, plug in the USB drive to the controller.
    3.        Hold down the reset button while powering on the controller.  Continue holding the reset button until the status light turns on, then release the reset button.
    4.        Wait for the controller to boot.  This should take less than a minute.
    5.        Check that the password has been reset to the default. (you will still be prompted for a password even if the default is blank)
    6.        Reinstall software to the controller. Using the USB reset will leave the system in a state where it is unable to run LVRT
      I have followed the procedure as mentioned 
    Result: the LED "Status" is permanently blinking.
    Would you please provide as with another alternative so that we can fix this issue.

  • Can anyone tell me how to get rid of tlb search? it unfortunately entered into my mac. Whenever I use safari, a pop-up window opens with some ads. Please help me to find a way to remove this malware.

    Can anyone tell me how to get rid of tlb search? It unfortunately entered into my mac. Whenever I use safari, a pop-up window opens with some ads. Please help me to find a way to remove this malware.

    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Very Urgent :  Error Page protection violation: This may be caused by submitting a page that had not yet finished loading or by manual alteration of protected page items. For further assistance, please contact the application administrator.

    Hi,
    I getting this error press on upload button , its working in google chrome and firefox
    Error Page protection violation:
    This may be caused by submitting a page that had not yet finished loading or by manual alteration of protected page items.For further assistance, please contact  theapplication administrator.Contact your application administrator.
    Please help me any one

    First, please don't post questions/issues and start with "Very Urgent".  If you have an "urgent" issue I recommend you contact Oracle Support.  Second, if your issue is so urgent, I further recommend that you read this (url below) before going any further.  Posting questions without including product names, versions, and related information like platform, configuration and so on, will make it almost impossible for anyone to help you.
    http://blogs.oracle.com/shay/entry/10_commandments_for_the_otn_fo
    Finally, I am going to guess and say that you are having problems with Oracle Apex version 4.2.  If I am correct, I will tell you that this forum space is for Oracle Forms.  APEX questions should be posted here (below).  However, if you plan to post the same issue there, please consider reading the blog I mentioned above and follow its recommendations before posting anywhere else.
    https://community.oracle.com/community/developer/english/oracle_database/application_express

  • My X1 version of Adobe no longer opens bank documents -"later version of Stratia required". Can you assist please?

    My X1 version of Adobe no longer opens bank documents -"later version of Stratia required". Can you assist please?

    Sorry but what is your answer to my enquiry?

Maybe you are looking for

  • Dock crashes while scrolling through the program list

    Hi there, when I click on the dock icon of my programs folder I can see the top of the list of my installed software. When I move the mouse cursor towards the down arrow ths lists begins to scrol until I reach the letter "S" - then the dock crashes.

  • How to add Web Portal in WLC

    Can someone explain or reffer any document how to integrate Web portal with WLC when some user will access network/internet with unsecured SSID he will get the Web Potal with information..not talking about Lobby Admin :) Wram Regards

  • B2B-51125:  No certificate to sign

    I have created a keystore with private certificate, imported the TP certificate and did the AS2 setup in Oracle B2B. While trying to sent a document over AS2 to the TP, I am getting below error. B2B-51125:  No certificate to sign Can someone please g

  • Apex Development Tools

    Hello, Any suggestion for good Apex 4.0 development tools? Thanks! Kind Regards, Cearnau Dan

  • Start-up loop

    I turned on my Pavilion DV6 yesterday and it is in a continous start-up loop. It gets to the HP logo screen and then re-starts. It repeats this continuously. I can press esc and it takes me to the start-up menu but (other than reset the BIOS which I'