Hi and I must know if this script is valid to determine if the Java console and my Java compiler need reinstalling. I have tried so many samples and my browser shows an invalid message. My file is named 'filename.class' and below is the script I have used to test Java on my computer (but I don't know much Java).
class filename
{
public static void main(String[] args)
{
short vara;
int varb;
long varc;
double vard;
float vare;
byte varf;
char varg;
String varh;
boolean vari;
vara=1;
varb=127349634;
varc=400000000;
vard=3.6290048129;
vare=95;
varf='i';
varg='/';
varh="this is a string";
vari=true;
System.out.print("short="+vara);
System.out.print("int="+varb);
System.out.print("long="+varc);
System.out.print("double="+vard);
System.out.print("float="+vare);
System.out.print("byte="+varf);
System.out.print("char="+varg);
System.out.print("String="+varh);
System.out.print("boolean="+vari);
}
}
Let me know if there are any errors in the above script. Also, the error report that I am given is first a message in the browser status bar saying "applet filename notinited" (filename is the name of the applet). Also the report is as follows:
load: filename.class is not public or has no public constructor.
java.lang.IllegalAccessException: Class sun.applet.AppletPanel can not access a member of class filename with modifiers ""
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Does anybody know what is going on here because I have never gotten a single script to work.
P.S. My java compiler is "JCreator LE" and I have Java 3D installed.