Hi,
please clarify how to overcome by this type of exception .
when I run my
java class ,it compiles fine.But it shows the runtime exception as unsupported class error.I am using jdk1.5.0_06
D:\sureshsai>javac NewClass.java
D:\sureshsai>java NewClass
Exception in
thread "main" java.lang.UnsupportedClassVersionError: NewClass (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
and also please tell me ,What is meant by a top level class?
here in this code,iam getting a compile time error.
protected class AnotherClass
{
}
class MyClass
{
public static void main(
String l[])
{
System.out.println("hello");
}
}
D:\sureshsai>javac MyClass.java
MyClass.java:1: modifier protected not allowed here
protected class AnotherClass