[Solved] Trouble creating method to go from pounds to kilograms [closed]


In Java, unlike in Python, there are no straight-up functions; everything is a method in a class. The closest you can get are static methods, which are associated with the class as a whole and not any particular instance of it.

The closest you can get in Java to the Python code you posted is this:

public class Conversions {
    public static double lbs2kg(double w) {
        return 0.453592 * w;
    }
}

I would definitely recommend learning the language from a book or tutorial such as those that others have suggested.

solved Trouble creating method to go from pounds to kilograms [closed]