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,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    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,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice