Static is something which is same for all instances
Vehicle.numberOfWheels refers to a static property or method called numberOfWheels that belongs to the Vehicle type itself. This is accessed directly through the class name without creating an instance of the class.Vehicle().numberOfWheels is a bit different. Here, Vehicle() is an expression that creates a new instance of the Vehicle class. The numberOfWheels in this context would refer to an instance property or method of that newly created Vehicle object. If numberOfWheels is a static property, this syntax would not be typical or necessary because static properties are accessed on the type, not on an instance.Example 1
class Vehicle {
static var numberOfWheels = 4 // Static property belonging to the type
var num = 23 // Instance property belonging to each instance
}
// Accessing static property using the class name
print(Vehicle.numberOfWheels) // Outputs: 4
// Creating an instance of Vehicle and accessing an instance property
print(Vehicle().num) // Outputs: 23