0
Why is this happening with code?
When I call methods using different objects it give me same output rather then giving me different outputs for different object? https://code.sololearn.com/cKpru3QkmicX/?ref=app
2 Respostas
+ 1
Here I wrote a little comment on changes
https://code.sololearn.com/cis3GcFHkReU/?ref=app
+ 1
Read about Static variable in Java.
It is a keyword which is used to share the same variable or method of a given class. Basically, static is used for a constant variable or a method that is same for every instance of a class.
You should remove the static keyword for your class variables. Then first get user inputs to separate weight and height variables and pass that while object creation.