I am trying to compile class B.java. And i am extending this class
with A. But it is giving me a error. I dont understand why it is
giving the error when both of them are defined in the same package.
I am mailing both of these java files....
A.java
------
package A;
public class A
{
public static void main(String args[])
{
System.out.println("I am in class A");
}
}
B.java
-----
package A;
public class B extends A
{
public static void main(String args[])
{
System.out.println("I am in class B");
}
}
Can anyone let me know what am i doing wrong.