Hi every body.
I have few questions
.
Let say we created a class named Car in our source file.
In the same source file I want to create two objects car1,car2, based on class Car( that is i want to create two instances of class Car)
Can i create these objects as shown below:
Car car1 = new Car();
Car car2= new Car ( );
My second question is let say i am writing a different
java program in a separate source file. I feel the need two create two objects car3 and car4 based on class Car.
1) In order to create these objects car3 and car4 in my program , the class Car must be imported in my source file . is it correct?
If correct, how do we do that ? I know for classes in API, we use import command.
I apologize for the long-winded post
Thanks and have a great day