How to call main method in one class from another class
Suppose i have a code like this
class Demo
{
public static void main(String args[])
{
System.out.println("We are in First class");
}
}
class Demo1
{
public static void main(String args[])
{
System.out.println("We are in second class");
}
}
In the above program how to call main method in demo calss from Demo1 class......?
there isn't anything mystical or special about the main method, it merely adheres to a specific method signature. You can call it the same way that you would call a method on any class from another class (Class.main(String[] args)).
No, i dont know how to call other than main methods from other classes And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add