My Question is:
I have a test.java class which is the main class. There is one more class(non-main class) which is present in JAR file. Now i want to compile and execute demo class present in JAR from the main class present outside the JAR. Please explain why.
public class test
{
public static void main(String args[])
{
demo d1 = new demo();
demo d2 = new demo("message passed from main class");
}
}
public class demo
{
demo()}
System.out.println("message in demo class");
}
demo(String str)
{
System.out.println(str);
}}