Forum : why Object is not created in main method?
Brief description  about Online courses   join in Online courses
View suman  dustakar 's Profile

why Object is not created in main method?

import Car_package.*;

public class CarImportPackage {

public static void main (String[] args)

{
Car.display (777, "Ferrari");
}
}

In the above class they hav called display method frm the Car_package by using the class "Car"(which is implemented in Car_package), can anybody plz explain me tht, Why Object is not created in the main method to call "display" method? how can they use the class "Car" to call display method Instead of using Object?......plz clear my doubt.. thanking u in advance...
Asked by suman dustakar | May 9, 2010 |  Reply now
Replies (2)
View arindam ghosh-roy 's Profile
Probably the method is a declared as static. In that case instance creation is not required.
Jun 15, 2010
View gurpreet kohli 's Profile
hi!! suman i thnk whether it is inheritence,packages or interfaces
the object of the main class is not created always..
May 11, 2010