About GregorianCalendar

shyam_oec's Avatar, Join Date: Nov 2007
Contributor
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 shabbir; 13Feb2008 at 17:15.. Reason: Code block
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
try writing "public class Gclaendar extends GregorianCalendar" instead of "class Gclaendar extends GregorianCalendar"
0
arbaz.it's Avatar, Join Date: Feb 2008
Ambitious contributor
Quote:
Originally Posted by pradeep
try writing "public class Gclaendar extends GregorianCalendar" instead of "class Gclaendar extends GregorianCalendar"
i m new to java can you please explain me the difference
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
This will help you understand http://forum.java.sun.com/thread.jsp...sageID=2761193