Groups | Blog | Home
all groups > vj# > march 2004 >

vj# : GregorianCalendar


Jason
3/23/2004 8:20:45 AM
I am trying to use a class that we wrote that extends
GregorianCalendar. But I get a CLR error
System.TypeInitializationException: The type initializer
for java.lang.System threw an exception.

Jason
3/23/2004 11:49:26 AM
I am using the java.util version. Is that a problem?


[quoted text, click to view]

Jason
3/23/2004 1:12:49 PM
Its nothing more advanced than yours.


[quoted text, click to view]

Lars-Inge Tønnessen
3/23/2004 5:44:17 PM
It means you should please show us your code. =:o)

Do you use the .net GregorianCalendar or the java GregorianCalendar ?


public class YoMan extends System.Globalization.GregorianCalendar
//java.util.GregorianCalendar
{
public YoMan()
{
super();
}
}

/**
* Summary description for Class1.
*/
public class Class1
{
public Class1()
{
YoMan on = new YoMan();
System.Console.WriteLine("Day: "+on.GetDayOfWeek(
System.DateTime.get_Now() ) );
}

/** @attribute System.STAThread() */
public static void main(String[] args)
{
new Class1();
}
}



Lars-Inge Tønnessen
www.larsinge.com

Lars-Inge Tønnessen
3/23/2004 6:15:42 PM
No, that is no problem.

Please give us a hint, show us your code.


public class YoMan extends java.util.GregorianCalendar
{
public YoMan()
{
super();
}
}

/**
* Summary description for Class1.
*/
public class Class1
{
public Class1()
{
YoMan on = new YoMan();
System.Console.WriteLine("Day: "+on.getTime().toGMTString() );
}

/** @attribute System.STAThread() */
public static void main(String[] args)
{
new Class1();
}
}



Lars-Inge Tønnessen
www.larsinge.com

AddThis Social Bookmark Button