0
v1.horn()
Vehicle.horn() preferable? Can use Vehicle.horn() even without v1=new Vehicle()?
1 Odpowiedź
+ 2
If your method is static than yes. You don't need to create an object for that. you can access that method with class name like
Class_Name.Method_Name
but if it is not static you have to create an object for that.