making an instance before calling non static method in java
问题 Hi could someone please explain to me why you have to create an instance before calling a non static method to the main function in java? What is the reasoning behind this? 回答1: Because, they are instance members,to access them you need instance. When a number of objects are created from the same class blueprint, they each have their own distinct copies of instance variables. In the case of the Bicycle class, the instance variables are cadence, gear, and speed. Each Bicycle object has its own