Why calendar don't work ?!!

i start learning java last week , so any one can help and tell me why this program don't work
import java.util.*;
public class Calendar
public static void main(String[] args)
     GregorianCalendar d= new GregorianCalendar();
     int today = d.get(Calendar.DAY_OF_MONTH);
     int month = d.get(Calendar.MONTH);
     d.set(Calendar.DAY_OF_MONTH, 1);
     int weekday = d.get(Calendar.DAY_OF_WEEK);     
     System.out.println("Sun Mon Tue Wed Thu Fri Sat");
     for (int i=Calendar.SUNDAY; i<weekday; i++)
     System.out.print(" ");
     do
     int day = d.get(Calendar.DAY_OF_MONTH);
     if (day<10) System.out.print(" ");
     System.out.print(day);
     if (day==today)
          System.out.print("* ");
     else
          System.out.print(" ");
     if (weekday==Calendar.SATURDAY) System.out.println();
     d.add(Calendar.DAY_OF_MONTH, 1);
     weekday = d.get(Calender.DAY_OF_WEEK);
     while (d.get(Calendar.MONTH)==month);
}

The class name "Calendar" is already used by Java.
Rename your class "MyCalendar" or something else and it almost all works.
Near the end of your code, you misspelled "Calendar" (you typed "Calender").
After making those two changes, your code compiled and ran for me.
Good luck!

Similar Messages

  • Why replace don't work?

    Hey guys why replace is not working?
    I know how to make it work. But, the procedure is to initialize the array before replacing. It does make sense that you cant replace, if it does not exist!
    But is there no other way?
    I have still not got what I love.....
    Attachments:
    replaceproblem.vi ‏8 KB

    I haven't seen your code, but I have to agree with Jim

  • Why mail don't work with hotmail?

    I was going to buy a macbook air 13" but i stopped because "mail" don't work with hotmail. The apple store Campania is not able to solve the problem.
    Help me

    Hotmail is now MS Outlook.com. To my knowledge all mail programs work with it in one way or another. Right Apple Mac Mail.app doesn't support the new MS exchange system, I forget what they call it for real, but from what I have read Outlook.com now supports IMAP which Apple Mac Mail.app supports.
    But then IMHO Mail.app is one of the worst mail clients. So alll you have to do is install another Email program like Outlook, in MS Office for Mac 2011, Thunderbird or some other mail program. Just because the Apple Mail.app progam may not work they way you want it to with any given mail provider doesn't mean you can't get email from that provider.

  • Why States don't work on Tablet view for text frames over background image?

    I have Macbook Pro with Top config on top S/W everything updated.
    Using Muse.
    Tablet view site.
    Simple text frames buttons with states over a full width background image - DON'T WORK!
    The text frame buttons are in TOP layer.
    Visible but do not respond to to any touch. UNLESS I delete the background image.
    Can't figure it out for days.
    Please help.
    Thanks
    Eli @

    TO MUSE STAFF!!!!
    I Found a major bug that needs to be fixed:
    In Tablet view:
    A linked text frame or state button has to be in the top layer to respond to states.
    If a composition menu is opening up and covering the button when triggered - THE BUTTON WILL NOT RESPOND EVEN IF THE COMPOSITION IS CLOSED!!!
    Only if the button is ARRANGED ABOVE the composition in the layer and becomes the absolute TOP OBJECT in the layer - ONLY THEN it will respond.
    PLEASE LET ME KNOW IF YOU GOT IT.
    I have tested it on a few projects and the bug is consistent.
    [email protected]
    Thanks for fixing it in the near future
    Eli

  • SP A60: Upon resume from standby, why devices don't work?

    Hi there,
    A question about my Toshiba Satellite Pro A60 (P2.8GHz, 40GB, Win XP Pro, as factory-delivered and extended with Belkin 54G PC-card wireless network adapter).
    When the laptop wakes up from standby, several devices don't work anymore, e.g. the wireless network-card. I haven't found anything to (un)check for Wakeup-On-Lan, resume, power management or anything similar.
    After a full reboot, all works fine again.
    What could I do to let all devices work the same after waking up from stand-by?
    Thanks in advance for your reply.
    Regards,
    Herman Zandt

    Hi Horwath
    Indeed not easy to explain. It doesn't make any difference if I use an AC power supply or battery, the same problem happens with both power sources.
    I re-checked the whole issue: upon pressing the on-switch on the SP A60 whilst it is blinking yellow (ie. A60 is in standby mode), it reboots perfectly without any errors. All devices work, ie. connectivity wireless card with base station ("excellent"), USB-ports, modem is recognised, touchpad works, DVD/CD-RW reads and soundcard works. (In fact, subject of this email is not correct anymore...)
    To be precise, what is NOT working is the data transfer, neither in my internal zone (LAN), nor outside (the Internet).
    Summarised: upon resuming from standby, the SP-A60 operates as being purely local without recognising anything outside the machine, despite the wireless network card being properly installed and excellent connectivity with the base station shown.
    As said, after full reboot all works fine again. No settings or checks have been found related to this. I'm running the latest BIOS.
    Any ideas? A hardware- or software-related issue?
    Thanks a zillion,
    Herman

  • Daily reminders in calendar don't work

    I have recently updated my 8900 online.  Since this update my daily reminders in calendar wont work.  Weekly, Monthly, Yearly, Every other day.  All these reminders work but not ones that are supposed to be daily.  I am epileptic and need to take daily medication, so to me these reminders are vital.
    My solution so far has been to put the reminder in as a weekly occurrence on every day of the week.  I also have Google Calendar reminding me.  Not the best solution when you have spent a few hundred pounds on a device.
    Any other answers please.

    Seriously? I ask Apple where to go to get answers to bugs and they direct me here, but no one here can fix the problem or even look into it. So I've been waiting two months for absolutely nothing because of further incompetence. What a terrible company.

  • Safari and Calendar don't works correctly

    Since yesterday Calender and Safari do not work. When I load Safari - it hangs and crashes. The calendar displays only birthdays, but on my macbook pro all right - shows and home and business calendar

    Hi djkos,
    Welcome to the Support Communities!
    To address this issue, I would suggest you close all open apps, then restart and reset your iPad.  Here's how:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Reset iPad settings - iPad User Guide
    http://help.apple.com/ipad/7/#/iPad9a74dc01
    Reset iPad settings. Go to Settings > General > Reset, then choose an option:
    Reset All Settings:  All your preferences and settings are reset.
    If the issue persists, you may need to back up and restore your iPad:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Cheers,
    - Judy

  • Why swf don't work

    I use after effects cs4,first I use Composition->New Composition,and import back.psd and rabbit.tga files.Then I use Pin Tool on rabbit.tga,and make it move. I use Composition->Preview->RAM Preview,I can see the rabbit.tga really moves. This is the effect which I want. At last,I use File->Export->Adobe Flash Player(SWF) to create a swf file,but when I run the swf,I find the rabbit.tga don't move!!! Why? Where is wrong?
    Any idea will be appreciated!
    Thanks

    Make sure that Rasterize Unsupported Features in your SWF export settings.

  • Why this don't work

    Hi all
    i did try this code for writing to a file but it doesn't work even i did use it beore and it was working any ideas???
    PrintWriter outT=
         new PrintWriter(     
                                  new BufferedWriter(
                                           new OutputStreamWriter(
                            new FileOutputStream ("C:/En.txt"),
                              enc)) );
    outT.print("why");

    Hi all
    i did try this code for writing to a file but it
    doesn't work even i did use it beore and it was
    working any ideas???
    PrintWriter outT=
         new PrintWriter(     
    new BufferedWriter(
    new OutputStreamWriter(
    new FileOutputStream ("C:/En.txt"),
    enc)) );
    "why");
    Replace this " new FileOutputStream( "c:/En.txt") " with " new FileOutputStream( "C:\\En.txt" ) "
    Try it:)

  • Why .bashrc don't work?(solved)

    it  seems that I was failed to set environment variables  in the ~/.bashrc  ?
    why?
    sorry for my poor English ?
    Last edited by fengya (2011-05-01 02:25:26)

    When used as a login shell bash tries to read ~/.bash_profile, ~/.bash_login, and ~/.profile, in  that order. Thus you need to source your ~.bashrc from one of these. Usually there is a ~/.bash_profile containing containing (as in my system):
    Source the .bashrc settings:
    . $HOME/.bashrc
    # Make sure the users bin directory will be searched in first place.
    if [ -d $HOME/bin ]
    then
    export PATH=$HOME/bin:$PATH
    fi
    # Make GTK use native windowing (for flash UI elements)
    export GDK_NATIVE_WINDOWS=1

  • Why sendBytesLong() don't work?

    I use sendBytesLong(byte[] outData, short bOff, short len) to send the respond apdu. But it doesn't work. My code as fellow:
    byte [] ch = fs.readBinary((short)(buf[ISO7816.OFFSET_P1]*0x100 +
    buf[ISO7816.OFFSET_P2]), buf[ISO7816.OFFSET_LC]);
    apdu.setOutgoingLength((short)(ch.length));
    apdu.sendBytesLong(ch, (short)0, (short)(ch.length));
    I debuge the program, and find the data is right in ch[], but it always return 6f00. It confuses me!

    You also need to call apdu.setOutgoing()

  • Notifications for Mail and Calendar don't work properly

    I only receive the Notifications from Mail and Calendar,
    when those applications are open and running.
    (yes, I have Preferences set to Alerts (not banners),
    all the following boxes are all checkmarked:
    Show in Notification 5 Recent Items
    Badge app icon
    Play sound when receiving notifications).
    I receive Notifications regarding other apps,
    such as Reminders, just fine, even when Reminders is closed.
    I usually have Mail and Calendar closed (not running)
    therefore I miss virtually all Notifications from those programs.
    If I have to have the programs (Mail and Calendar) open all the time,
    what's the point of Notifications?
    When Mail and Calendar are open and running,
    they alert the user with their own alerts
    (without need for Notifications).

    appleuser8000 wrote:
    I only receive the Notifications from Mail and Calendar,
    when those applications are open and running.
    Mail
    That is the expected behavior.
    Best.

  • Why tcpdump don't work?

    My OS is Solaris10,tcpdump can run well before. Now I find I can't run it,like follows:
    $tcpdump
    tcpdump: not found
    #tcpdump
    tcpdump: not found
    Why? I am puzzled with it!

    Solaris doesnt ship with tcpdump. It comes with a similar utility called snoop.
    Alternatively you may be able to download tcpdump from somewhere like blastwave.

  • Why "contacts" don´t work in IOS5 in my iphone 4 ?

    Hi
    after upgrade to IOS5 , "contacts" in my iPhone doesn´t work...if I want to add a new contact, edit, search a friend to send a message, SMS or Email...
    What I have to do ?  Downgrade to IOS 4.x ?
    tks
    Gilson

    I found the problem
    I had to delete all the messages and start new one

  • Why behaviors don't work when there is a previous fixed div in the same page?

    I have an image fixed at the beginning of the page.
    After that, I have a div with images in which I have applied the swap image behavior, but the behavior doesn't work.
    If I change the positioning of my image fixed, so, if that image is in position absolute, relative o whatever (unless fixed), the following divs show the swap image behavior.
    What happens?

    of course, MurraySummers, but it's long, ans some words are in spanish...
    <title>SYNCHRO FACTORY</title>
    <link href="synchrofactory.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    body {
        background-repeat: no-repeat;
        background-color: #000000;
        background-image: url(imagenes/franja_sup_burbujas2.png);
    a:link {
        text-decoration: none;
    a:visited {
        text-decoration: none;
    a:hover {
        text-decoration: none;
    a:active {
        text-decoration: none;
    -->
    </style>
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    </script>
    </head>
    <body onload="MM_preloadImages('imagenes/transpPVP.jpg','imagenes/transpPVP.png')">
    <div id="contenedor">
      <div id="cabecerafija"><img src="imagenes/cabecerafija4.png" width="1280" height="1201" usemap="#Map" border="0" />
        <map name="Map" id="Map">
          <area shape="circle" coords="71,550,48" href="#logo2" />
          <area shape="circle" coords="83,790,40" href="#logo3" />
          <area shape="circle" coords="187,672,40" href="#logo1" />
        </map>
      </div>
      <div id="paginahome">
        <div id="logo1"><img src="imagenes/logo_cel_700px.png" width="700" height="239" /></div>
        <div id="texthome">
          <h1>UN DEPORTE<br />
            UN ESPECTÁCULO</h1>
          <h2>Joyas de sincro. Llévalas, lúcelas. Pasión por la natación sincronizada</h2>
          <br />
          <br />
        </div>
        <div id="galeria"><img src="imagenes/fons_sara_videoclip.jpg" width="1030" height="402" /></div>
      </div>
      <div id="paginatienda">
        <div id="text">
          <div id="logo2"><img src="imagenes/logo_cel_700px.png" width="700" height="239" id="Image2" /></div>
        </div>
        <div id="cuadroproductos">
          <div id="imatge1"><a href="http://www.synchrofactory.com" onmouseover="MM_swapImage('sincro1','','imagenes/transpPVP.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="imagenes/sincro1_provaweb.jpg" width="200" height="140" id="sincro1" /></a></div>
          <div id="imatge2"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro2','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro2_provaweb.jpg" width="200" height="140" id="sincro2" /></a></div>
          <div id="imatge2"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro3','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro3_provaweb.jpg" width="200" height="140" id="sincro3" /></a></div>
          <div id="imatge1"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro4','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro4_provaweb.jpg" width="200" height="140" id="sincro4" /></a></div>
          <div id="imatge2"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro5','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro5_provaweb.jpg" width="200" height="140" id="sincro5" /></a></div>
          <div id="imatge2"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro6','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro6_provaweb.jpg" width="200" height="140" id="sincro6" /></a></div>
          <div id="imatge1"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro7','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro1_provaweb.jpg" width="200" height="140" id="sincro7" /></a></div>
          <div id="imatge2"><a href="index2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sincro8','','imagenes/transpPVP.png',1)"><img src="imagenes/sincro2_provaweb.jpg" width="200" height="140" id="sincro8" /></a></div>
          <div id="quadretext">Plata 925 rodiada. Bronce chapado en oro de 2 micras con baño anticadmio y antialérgico según normativa europea vigente. Modelos e ilustraciones patentados. Bla, bla, i requeteblá.</div>
        </div>
      </div>
      <div id="paginacontacto">
        <div id="text">
          <div id="logo3"><img src="imagenes/logo_cel_700px.png" width="700" height="239" /></div>
        </div>
        <div id="contacto">
          <div id="cuadroimagenes">
            <div id="imatge1"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge1"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
            <div id="imatge2"><img src="imagenes/prova_duo140x200.jpg" width="140" height="200" /></div>
          </div>
        </div>
      </div>
    </div>
    </body>
    </html>

Maybe you are looking for