Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   About GregorianCalendar (http://www.go4expert.com/forums/about-gregoriancalendar-t8798/)

shyam_oec 13Feb2008 13:38

About GregorianCalendar
 
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?

pradeep 13Feb2008 15:28

Re: About GregorianCalendar
 
try writing "public class Gclaendar extends GregorianCalendar" instead of "class Gclaendar extends GregorianCalendar"

arbaz.it 14Feb2008 14:40

Re: About GregorianCalendar
 
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

pradeep 14Feb2008 14:44

Re: About GregorianCalendar
 
This will help you understand http://forum.java.sun.com/thread.jsp...sageID=2761193


All times are GMT +5.5. The time now is 12:33.