Answer the question
In order to leave comments, you need to log in
When calculating the volume, it gives an error. What is the error?
package com.company;
import java.util.Scanner;
public class Main {
public static class Person_Volume{
public double volume;
Scanner scan=new Scanner(System.in);
double ODD_Volume = scan.nextDouble();
public void Set_Volume(double Weight){
ODD_Volume = Weight;
}
double Get_Volume(){
int P = 1000;
double volume = P/ODD_Volume;
return volume;
}
}
public static void main(String[] args){
Person_Volume dmitriy = new Person_Volume();
dmitriy.Set_Volume();
dmitriy.Get_Volume();
System.out.println(dmitriy.volume);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question