
how to call a another java file in java

Java Call a class from another class
1)Hello.java:
class Hello{
public String name="RoseIndia";
public String getName(){
return name;
}
}
2)CallClass.java:
class CallClass{
public static void main(String[] args)
{
Hello h=new Hello();
String st=h.getName();
System.out.println("Hello "+st);
}
}

That's quite self-explanatory example :) :) But I have a Question. What would be the syntax if the class hello already has a constructor and object is called in its main method? How would then it be called in CallClass ? Reply Awaited !!!! :)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.