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?
try writing "public class Gclaendar extends GregorianCalendar" instead of "class Gclaendar extends GregorianCalendar"
This will help you understand http://forum.java.sun.com/thread.jspa?threadID=561179&messageID=2761193