1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

About GregorianCalendar

Discussion in 'Java' started by shyam_oec, Feb 13, 2008.

  1. shyam_oec

    shyam_oec New Member

    Joined:
    Nov 26, 2007
    Messages:
    89
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Software Developer, .NET Framework
    Location:
    Jamshedpur
    Code:
    import java.util.*;
    
    class Gclaendar extends GregorianCalendar
    {
        String toString()
        {
            return "hi....";
        }
    }
    
    class GcalendarDemo
    {
    public static void main(String [] args)
      {
         Gcalendar gc=new GregorianCalendar();
       }
    }
    while compiling above code it gives error :attempting to assign weaker access priviledge.
    why does it so?
     
    Last edited by a moderator: Feb 13, 2008
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    try writing "public class Gclaendar extends GregorianCalendar" instead of "class Gclaendar extends GregorianCalendar"
     
  3. arbaz.it

    arbaz.it New Member

    Joined:
    Feb 13, 2008
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    0
    i m new to java can you please explain me the difference
     
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:

Share This Page