I'm trying to make a simple pounds to kilogram converter. Not sure what I'm doing wrong because it won't print out the answer. Could someone help me out.
public class ass10 {
public static void main(String[] args) {
double lbs2kg(3);
}
public double lbs2kg(double w){
System.out.println(w/2.2);
}
}
Delete double or put a variable and also method lbs2kg() must be static
(Make it return double or a compatible type, too).
public static void main(String[] args) {
double x = lbs2kg(3);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With