Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
class Area
{
private final double width;
private final double height;
Area(double width, double height)
{
this.width = width;
this.height = height;
}
double getSurfaceArea()
{
return this.height * this.width;
}
}
public class Something
{
private double value;
public Something(double value)
{
this.value = value;
}
public double getValue()
{
return value;
}
}
public class Test
{
public static void main(String[] args)
{
Area field = new Area(20, 10);
System.out.println(field.getSurfaceArea()); //A
Something something = new Something(field.getSurfaceArea());
System.out.println(something.getValue()); //B
}
}
/** Konsolenausgabe */
200.0 //A
200.0 //B